#How do I use functions from @ember/debug or @ember/destroyable when those packages do not exist?
1 messages · Page 1 of 1 (latest)
I think they’re in ember-source
I appear to be unable to share images here but I confirmed this by using the “explore” view on npm, they’re in dist/packages/@ember
are you working outside an Ember CLI context? Normally these things all come automatically in the Ember CLI blueprint
something maybe confusing is that you would import { destroy } from '@ember/destroyable', so it being ember-source underneath is not clear
yeah I am trying to work on an issue where it's not an ember app but an addon for ember and it just needs to use some functions from those two ^^ packages...it threw me off a little that they aren't separate installable packages without ember-source
Back again...so I tried installing ember-source and @ember/string but I am getting the following build error:
(0, string_1.camelize) is not a function
what’s your import statement? What version of Ember?
hmm… are there other imports from '@ember/? I would expect them to all work the same way
there was also @ember/debug but that also failed
is this a true Ember addon? I think the “resolver” is the thing that translates these imports to ember-source underneath
I think it is but I am not sure if it's a v2 addon, trying to PR to this package/folder: https://github.com/josemarluedke/docfy/tree/main/packages/ember
ah okay. I think it’s not v2 since it doesn’t have that in package.json (ember-addon.version)
how are you running the code?
mysterious… this gets pretty hideous but sometimes when imports aren’t working I do things like
import X from '@ember/string`;
console.log('import', X);
or even
window.stringImport = X
so I can poke around at it
also josemarluedke does exist here haha
you can call it anything, I just attach it to window so I can see the shape of it
oh I see
import * as emberString from '@ember/string';
console.log({emberString})
// prints
{
emberString: {
name: [Getter],
treeForAddon: [Getter],
default: { name: '@ember/string', treeForAddon: [Function treeForAddon]
}
}
hmm that seems v wrong 😳
I'm honestly super confused as to what's going on, so any tips (even guessing) would be appreciated lol
There’s a specific @ember/string package now, I wonder if installing that would make a difference https://www.npmjs.com/package/@ember/string
I had that installed along with ember-source but the versions don't match up (the latest of @ember/string seems to be 3.0.1 or something)
Right now rolling that back and trying again just with ember-source
Okay without @ember.string it's saying Cannot find module @ember/string (this is with ember-source installed)
whaaa
what version of ember-resolver do you have?
@ember/string is in the process of being extracted https://github.com/ember-cli/ember-resolver/blob/master/CHANGELOG.md#v1000-2023-01-11