question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect resolve attached to `ember-source`. ModuleNotFoundError.

See original GitHub issue

Similar 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'
pretender_es_js_—_workspace__Workspace_

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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
ef4commented, Aug 11, 2021

There is now some in progress work for this issue here: https://github.com/embroider-build/embroider/pull/919

1reaction
alexlafrosciacommented, Jul 20, 2021

@ef4 is it the customAddonTree that is updating the module paths? I’d love to try to fix this, but reading through the ember-source compat adapter I can’t quite find anything that looks like it’s updating module paths

https://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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found