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

Failed to import miragejs #683

Closed
bertdeblock opened this issue Feb 2, 2022 · 6 comments · Fixed by #684
Closed

Failed to import miragejs #683

bertdeblock opened this issue Feb 2, 2022 · 6 comments · Fixed by #684
Labels

Comments

@bertdeblock
Copy link
Contributor

5.0.0-beta.5 breaks our build with the following error:

Build Error (WebpackBundler)

ember-file-upload tried to import "miragejs" in "ember-file-upload/mirage/index.js" but the package was not resolvable from /Users/bertdeblock/Code/bagaar/projects/mobility-buddy/mobility-buddy-frontend/node_modules/ember-file-upload


Stack Trace and Error Report: /var/folders/q5/sg7x51yn0v5d4snmcrmcxxk00000gn/T/error.dump.ea295ef192933e99591559f0aa01612f.log

Installing miragejs ourselves fixes the issue, but our project doesn't use / need MirageJS.

@gilest
Copy link
Collaborator

gilest commented Feb 2, 2022

This will be related to #664

Are you using embroider? I'll try to investigate and repro tomorrow

@gilest gilest added the bug label Feb 2, 2022
@bertdeblock
Copy link
Contributor Author

We are not at the moment. Thanks! Let me know if you need any additional info.

@pjcarly
Copy link

pjcarly commented Feb 2, 2022

I am trying out embroider, and seeing this issue (with beta-5), not with (beta-3)

@gilest
Copy link
Collaborator

gilest commented Feb 3, 2022

I have a fix in #684 which I have tested manually in all four scenarios eg. with/without embroider and with/without mirage.

I'm not merging right away as the embroider CI builds are unhappy.

It would be helpful in the meantime if you could please try with the fix installed and report back:

"ember-file-upload": "adopted-ember-addons/ember-file-upload#fix/auto-import-exlcude-miragejs",

@pjcarly
Copy link

pjcarly commented Feb 3, 2022

I can confirm my build is succeeding with your fix. Cheers

gilest added a commit that referenced this issue Feb 7, 2022
Fixes #683

I created a local reproduction, checked the ember-auto-import docs and some real world examples from the @embroider/macros docs.

It seems like if we're conditionally importing modules using importSync/macros then we need to explicitly exclude them from ember-auto-import.

Have tested this manually with a minimal repro. This could be replicated by adding more ember-try scenarios and using @embroider/macros to gate some tests.

Also regenerated yarn.lock.
@gilest
Copy link
Collaborator

gilest commented Feb 7, 2022

Fixed in v5.0.0-beta.6

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

Successfully merging a pull request may close this issue.

3 participants