@ember/string is not a dependency
timiyay opened this issue · 4 comments
This package imports @ember/string
, but doesn't list it in its package.json
:
I'm investigating an issue with a Yarn workspaces monorepo we have for our Ember addons, and opened this issue to try and clarify whether @ember/string
is expected to be available some other way, such as via ember-source
.
Our use case is:
- we're incrementally upgrading our addons from Ember 3.20 to Ember 3.24
- some addons have a dev dependency on
ember-data
- when
ember-data
is upgraded to~3.24
for one addon, other addons that are still onember-data@3.20
start failing CI with an errorUncaught Error: Could not find module @ember/string imported from 'ember-inflector/lib/system/inflector'
I'm still investigating exactly what's causing our issues, it may be a combination of issues related to Yarn workspaces hoisting, and the fact that ember-data@3.24
adds @ember/string
as a dependency.
At present, everything seems in order though, both packages are installed in the top-level node_modules
directory:
node_modules/@ember/string
node_modules/ember-inflector
@timiyay did you ever figure this out? I have a similar issue with my Yarn workspace
@EWhite613 we did, though I'm struggling to find the history of how we did it. We have some notes, but I'm not sure they were the final fix. I'll add them here anyway, in case it helps.
The trigger for our problems was upgrading ember-data
from 3.20
to 3.24
in our Ember addons. This seemed to be enough to cause builds to fail with Uncaught Error: Could not find module @ember/string imported from ember-inflector/lib/system/inflector
.
This error would show up in the apps that consume these addons, when trying to build.
Our fix was to upgrade ember-data
all in one push for all addons, which was easy enough since they were in 1 monorepo.
After that, we'd have to bump these addons and ember-data
in our apps at the same time.
That's the best I can recall of our story 😅
Ember 5 removed automatic import of @ember/string
. Wouldn't it be necessary to add @ember/string
now to the dev-dependencies of this project, since it is using features of this module? That would allow to use it in Ember 5 projects without needing to list @ember/string
as dependency though it is not really used in the project itself.