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

[type=module] Library cannot import from @ember/* #1761

Closed
NullVoxPopuli opened this issue Jan 17, 2024 · 3 comments
Closed

[type=module] Library cannot import from @ember/* #1761

NullVoxPopuli opened this issue Jan 17, 2024 · 3 comments

Comments

@NullVoxPopuli
Copy link
Collaborator

I expected this is something that wouldn't work, but opening this for tracking purposes.


Demo/Repro: NullVoxPopuli/ember-resources#1111

Log:

ERROR in ../../.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist/index.js 6:0-38
Module not found: Error: Can't resolve '@ember/debug' in '<repo>/test-app/node_modules/.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist'
 @ ./tests/core/rendering-test.ts 8:0-66 14:17-21 15:24-28 16:19-34 17:15-23
 @ ./assets/test.js 26:13-61

ERROR in ../../.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist/index.js 7:0-77
Module not found: Error: Can't resolve '@ember/helper' in '<repo>/test-app/node_modules/.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist'
 @ ./tests/core/rendering-test.ts 8:0-66 14:17-21 15:24-28 16:19-34 17:15-23
 @ ./assets/test.js 26:13-61

ERROR in ../../.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist/index.js 9:0-92
Module not found: Error: Can't resolve '@ember/destroyable' in '<repo>/test-app/node_modules/.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist'
 @ ./tests/core/rendering-test.ts 8:0-66 14:17-21 15:24-28 16:19-34 17:15-23
 @ ./assets/test.js 26:13-61

ERROR in ../../.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist/index.js 10:0-129
Module not found: Error: Can't resolve '../../../../@[email protected]_@[email protected]/node_modules/@embroider/macros/src/addon/es-compat2' in '<repo>/test-app/node_modules/.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist'
Did you mean 'es-compat2.js'?
BREAKING CHANGE: The request '../../../../@[email protected]_@[email protected]/node_modules/@embroider/macros/src/addon/es-compat2' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ./tests/core/rendering-test.ts 8:0-66 14:17-21 15:24-28 16:19-34 17:15-23
 @ ./assets/test.js 26:13-61

4 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.89.0 compiled with 4 errors in 1602 ms
cleaning up...
Build Error (PackagerRunner) in ../../.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist/index.js

Module not found: Error: Can't resolve '@ember/debug' in '<repo>/test-app/node_modules/.pnpm/file+..+ember-resources_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/ember-resources/dist/index.js'


Stack Trace and Error Report: /tmp/error.dump.70bbc4b94e9a8320db10d8fc39e50e26.log
@ef4
Copy link
Contributor

ef4 commented Jan 18, 2024

Your reproduction says it removes "ember-addon" from keywords. Why? That is intentionally not supported. Random NPM packages don't get the custom resolving needed to access the made-up ember packages that ship inside ember-source.

@NullVoxPopuli
Copy link
Collaborator Author

Why?

Was trying to find some work around for ember-addons not being allowed to be type=module. I thought, maybe if i ditch everything, it'll work? It's fine to not be allowed to remove keywords [ember-addon], for the reason you mentioned.

@NullVoxPopuli
Copy link
Collaborator Author

Going to close for now. Not a bad tradeoff to require a keyword and not have to declare 15 peers 😅

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

2 participants