Incorrect resolve attached to `ember-source`. ModuleNotFoundError.
See original GitHub issueSimilar issue to https://github.com/embroider-build/embroider/issues/817. I have an app where I’m trying out embroider. This app uses mirage, and it depends on pretender "^3.4.3"
. I’m getting this build error:
Build Error (PackagerRunner) in ../../../../../../../../Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js
Module not found: Error: Can't resolve 'ember-source/route-recognizer/index.js' in '/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js'
Somehow it’s trying to resolve route-recognizer
from ember-source/route-recognizer/index.js
? 🤔
Logs
ERROR Summary:
- broccoliBuilderErrorStack: ModuleNotFoundError: Module not found: Error: Can’t resolve ‘ember-source/route-recognizer/index.js’ in ‘/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js’ at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/Compilation.js:1762:28 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:732:13 at eval (eval at create (/Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:1) at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:274:22 at eval (eval at create (/Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1) at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:403:22 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:117:11 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:648:24 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:802:8 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:922:5
- code: [undefined]
- codeFrame: Module not found: Error: Can’t resolve ‘ember-source/route-recognizer/index.js’ in ‘/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js’
- errorMessage: …/…/…/…/…/…/…/…/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js: Module not found: Error: Can’t resolve ‘ember-source/route-recognizer/index.js’ in ‘/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js’ at PackagerRunner (@embroider/webpack)
- errorType: Build Error
- location:
- column: [undefined]
- file: …/…/…/…/…/…/…/…/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js
- line: [null]
- treeDir: [undefined]
- message: …/…/…/…/…/…/…/…/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js: Module not found: Error: Can’t resolve ‘ember-source/route-recognizer/index.js’ in ‘/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js’ at PackagerRunner (@embroider/webpack)
- name: Error
- nodeAnnotation: @embroider/webpack
- nodeName: PackagerRunner
- originalErrorMessage: Module not found: Error: Can’t resolve ‘ember-source/route-recognizer/index.js’ in ‘/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js’
- stack: ModuleNotFoundError: Module not found: Error: Can’t resolve ‘ember-source/route-recognizer/index.js’ in ‘/Users/esbanarango/Developer/embroiderTestApp/node_modules/pretender/dist/pretender.es.js’ at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/Compilation.js:1762:28 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:732:13 at eval (eval at create (/Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:1) at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:274:22 at eval (eval at create (/Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1) at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:403:22 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:117:11 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:648:24 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:802:8 at /Users/esbanarango/Developer/embroiderTestApp/node_modules/webpack/lib/NormalModuleFactory.js:922:5
"@embroider/compat": "^0.41.0",
"@embroider/core": "^0.41.0",
"@embroider/webpack": "^0.41.0",
...
"ember-source": "3.28.0-beta.5"
"ember-cli-babel": "^7.26.6",
"ember-cli-mirage": "2.2.0",
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Incorrect monorepo package resolution? @glimmer/syntax ...
And here is where I think it might be a resolution problem, ember-source is in my monorepo-root node_modules (with @glimmer/util.js):.
Read more >[Embroider] dependencySatisfies gives wrong answer for ...
Hey, I have a similar problem to Help needed - struggling to find/resolve a deprecation : I'm trying to get rid of the...
Read more >ember.js - Could not resolve dependency error - Stack Overflow
I'm just trying to create a new app from scratch, but getting this error: Command failed with exit code 1: npm install --loglevel...
Read more >ember-source - npm
A JavaScript framework for creating ambitious web applications. Latest version: 4.9.3, last published: 11 days ago. Start using ember-source ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is now some in progress work for this issue here: https://github.com/embroider-build/embroider/pull/919
@ef4 is it the
customAddonTree
that is updating the module paths? I’d love to try to fix this, but reading through theember-source
compat adapter I can’t quite find anything that looks like it’s updating module pathshttps://github.com/embroider-build/embroider/blob/fe30c4c5a942e608c81082433940b530bfd6a7b2/packages/compat/src/compat-adapters/ember-source.ts#L38-L47
If you have an idea of what this fancier compat adapter would look like and can walk through the gist of it, I’d be up for trying to get the compat adapter working to resolve this issue