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

Build fails with "Can't resolve ...@embroider/macros..." #1501

Closed
gitKrystan opened this issue Jun 30, 2023 · 2 comments · Fixed by #1504
Closed

Build fails with "Can't resolve ...@embroider/macros..." #1501

gitKrystan opened this issue Jun 30, 2023 · 2 comments · Fixed by #1504

Comments

@gitKrystan
Copy link

gitKrystan commented Jun 30, 2023

Example: https://github.com/ember-learn/guidemaker-ember-template/actions/runs/5416696506/jobs/9857850370#step:5:82

https://discord.com/channels/480462759797063690/568935504288940056/1124312264204374177

ERROR in ../rewritten-packages/ember-svg-jar.e02db158/_app_/helpers/svg-jar.js 1:0-102
Module not found: Error: Can't resolve '../../../../../@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat' in '/home/runner/work/guidemaker-ember-template/guidemaker-ember-template/node_modules/.embroider/rewritten-app/helpers'
resolve '../../../../../@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat' in '/home/runner/work/guidemaker-ember-template/guidemaker-ember-template/node_modules/.embroider/rewritten-app/helpers'
  using description file: /home/runner/work/guidemaker-ember-template/guidemaker-ember-template/node_modules/.embroider/rewritten-app/package.json (relative path: ./helpers)
    Field 'browser' doesn't contain a valid alias configuration
    No description file found in /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon or above
    no extension
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat doesn't exist
    .wasm
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat.wasm doesn't exist
    .mjs
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat.mjs doesn't exist
    .js
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat.js doesn't exist
    .json
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat.json doesn't exist
    .ts
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat.ts doesn't exist
    .hbs
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat.hbs doesn't exist
    .hbs.js
      Field 'browser' doesn't contain a valid alias configuration
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat.hbs.js doesn't exist
    as directory
      /home/runner/work/guidemaker-ember-template/@embroider/compat/node_modules/@embroider/macros/src/addon/es-compat doesn't exist
 @ ./assets/dummy.js 535:13-48
@ef4
Copy link
Contributor

ef4 commented Jun 30, 2023

The bug is probably around here:

return explicitRelative(dirname(this.sourceFile), join(runtimeAddonPath, moduleName));

@ef4
Copy link
Contributor

ef4 commented Jul 1, 2023

I think this is fixed by #1504.

However, after fixing that the linked guidemaker-ember-template tests still don't pass, and I think that's because ember-cli-showdown is doing a silly thing where it pulls in showdown.js twice, and one copy gets the extensions registered and the other is missing them, and the specific implementation details of embroider may have changed enough that the copy without the extensions is suddenly being used.

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

Successfully merging a pull request may close this issue.

2 participants