Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: ember-tooltips is trying to import the app's @ember/string package, but it seems to be missing #447

Open
Turbo87 opened this issue Jul 24, 2024 · 7 comments

Comments

@Turbo87
Copy link
Member

Turbo87 commented Jul 24, 2024

In rust-lang/crates.io#9011 I'm trying to update @ember/string to the v4 release, but apparently that is causing the build to fail, claiming that the package is missing.

It looks like every single dependency in the ecosystem that is relying on @ember/string now needs to publish a breaking change release to update their dependencies, or am I missing something?

@NullVoxPopuli
Copy link
Sponsor Contributor

NullVoxPopuli commented Jul 24, 2024

@ember/string @ v4 is a breaking change, and requires the following for older ember-ecosystem packages to to use v4

  • ember-auto-import @ > v2 or embroider (or be a v2 addon)
  • ember-source >= 3.28

Additionally packages using @ember/string, as of ember-source @ v5, must declare it in either their dependencies or peerDependencies

If all 3 of those conditions are met, then the @ember/string @ v3 to v4 migration can happen without a breaking change for each package using @ember/string

What packages, in particular are you noticing having issues?

@Turbo87
Copy link
Member Author

Turbo87 commented Jul 24, 2024

sure, but why does updating the package in the app break the build for the addons that use the previous version?

@NullVoxPopuli
Copy link
Sponsor Contributor

NullVoxPopuli commented Jul 24, 2024

I'd wager it's a compatibility mistake, due to the old way of doing things in broccoli land (or it's just a problem that's always been there, and is just now manifesting)

@ember/string didn't used to come from a package at all -- it came from the ether! (ember-source, as just a file).

Once all dependencies are v2 addons, the problem will cease to exist (which might be a while from now at the rate I'm going 😅 )
(especially because "in the world of old", package.jsons were incorrect)

I would experiment with pnpm's packageExtensions config to add @ember/string to dependencies trying to import from it.

Library-wise, what I think folks should do, is set their dependencies entry on @ember/string explicitly, and potentially set the version range to ^3.0.0 || ^4.0.0

@kategengler
Copy link
Member

I'm hitting this upgrading to @ember/string v4 as well.
The app is on v5.8 with latest ember-auto-import and embroider.

This is the stack trace:

vendor.js:254 Uncaught 
Error: Could not find module `@ember/string` imported from `(require)`
    at missingModule (vendor.js:254:11)
    at findModule (vendor.js:265:7)
    at requireModule (vendor.js:31:15)
    at eval (?../../.pnpm/@embroi…my-app:1:18)
    at ../../.pnpm/@embroider+babel-loader-9@3.1.1_@embroider+core@3.4.14_supports-color@8.1.1_webpack@5.93.0/node_modules/@embroider/babel-loader-9/index.js?{"variant":{"name":"dev","runtime":"browser","optimizeForProduction":false},"appBabelConfigPath":"/Users/katie/dev/my-app/node_modules/.embroider/rewritten-app/_babel_config_.js","cacheDirectory":"/private/var/folders/wq/_yzzcnwn3wlfm5x_6gg5d8vm0000gn/T/embroider/webpack-babel-loader"}!../../.pnpm/@embroider+webpack@4.0.4_@embroider+core@3.4.14_webpack@5.93.0/node_modules/@embroider/webpack/src/virtual-loader.js?f=%2F%40embroider%2Fext-cjs%2F%40ember%2Fstring&a=%2FUsers%2Fkatie%2Fdev%2Fmy-appi! (chunk.7677c78….js:357:1)
    at __webpack_require__ (chunk.ee17d04….js:1463:42)
    at eval (index-cc461d33.js:30:71)
    at ../rewritten-packages/@ember-data/store.ccec4f6a/node_modules/@ember-data/store/index-cc461d33.js (chunk.7b68ccb….js:1536:1)
    at __webpack_require__ (chunk.ee17d04….js:1463:42)
    at eval (index.js:13:73)
    ```
    

@NullVoxPopuli
Copy link
Sponsor Contributor

Looks like @ember-data/store needs to declare @ember/string in their deps.

@runspired
Copy link

Its more likely an outdated version of @ember-data/store

@kategengler
Copy link
Member

It is indeed 4.12.8 of @ember-data/store (matching my ember-data version).

It is fine that I cannot upgrade this package but I wonder if we could make the errors more helpful somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants