-
Notifications
You must be signed in to change notification settings - Fork 137
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
All ember-source modules missing from a build #1116
Comments
May be related, I also see this:
In my case since |
Neither of these should happen, all of these imports are supposed to get rewritten to point at things coming from ember-source before webpack sees them. Can somebody share a reproduction that does this? |
(Maybe this is a canary thing, our CI is not currently running against canary so it could be broken and I wouldn't necessarily have noticed yet.) |
Just tried in a brand new app (3.28) and was unable to repro (embroider v1.2.0). Must be something else in my main app. Sadly decided not to hold onto that play branch so I'll have to repro and look at debug logs again later! |
I have a reproduction -- kinda happened by accident -- but ran in to this error:
NullVoxPopuli/ember-popperjs#142 test-app has ember-source 4.1.0 |
Another repro: ember-polyfills/ember-functions-as-helper-polyfill#111 🤔 Surely there is something common between all these 🤔 |
There are probably at least two different bugs being reported in this thread now. It matters whether the place that is failing to import from ember is code in the app or code in an addon (and whether that addon is a v2 addon). I looked at the ember-functions-as-helper-polyfill reproduction and that is a failure coming from inside ember-welcome-page (a v2 addon in the test-app). It's probably a different bug from the original report. |
I had success by removing ember-welcome-page when migrating to v2 addon format ember-intl-changeset-validations. Feel free to grab the branch & investigate. |
I've gotten my app back into this state and have saved the branch this time (now with
In my case, the import is in a component in my app (not from an addon). I tried running with |
Does it keep reproducing after you |
Also, do you have |
Yeah. Side note: Does I used the one where the full stack trace from the build1 (before
Output of `npm ls @ember/string` shows ember-data as the only consumer
I tried Footnotes
|
…. No clue what's causing this (seems no one else has a clue either). Related issue: embroider-build/embroider#1116
Got another occurrence here: CrowdStrike/ember-aria-utilities#6 Though, not sure what the difference is between that an ember-resources. |
alright, so my issue was that the v2 addon didn't have (at least most immediately, I have other things to figure out as well) |
@vlascik do you still have this issue / did |
@NullVoxPopuli well, my original problem (all ember-source modules missing) seems to be resolved - the app builds and boots. However, some modules are still missing - as far as I can tell the scenario is this:
I was able to create a reproduction here https://github.com/vlascik/repro-embroider-missing-modules Vanilla ember new app depends on
because of an import from Adding |
This is the correct behavior, in modern packagers, you cannot import from things you do not, yourself, declare |
Gonna close this for now -- if anyone is having a similar error, let's open a new issue so we don't get distracted / confused (I would!) with all the things in this thread. |
@NullVoxPopuli Got any link for that? Because as far as I was able to find, webpack shouldn't care where was dependency declared, as long as it is in node_modules, and builds its own dependency graph based on import statements https://webcache.googleusercontent.com/search?q=cache:xN1si4ZIZLwJ:https://blog.jakoblind.no/how-webpack-decides-what-to-bundle/ and webpack/webpack#6547 (comment) Also, the behavior of classic ember build system, where addon's |
this is the kicker, you can't guarantee it is, because how node_modules is organized is an implementation detail of the package manager. in both yarn@v1 and npm (which have broken dependency management techniques, though npm@8 is quite a bit better), the will shove everything flatly into node_modules -- this gives you the illusion that you can import your transient dependencies. What yarn3, pnpm, and npm@8 (with strict settings still enabled) do is manage deps correctly, in that you can only import what is declared in your package.json (be that via nested node_modules, or whatever other technique they're implementing). This isn't an emborider issue -- embroider is following the correct resolution algorithm, in that it doesn't re-implement bugs that yarn@v1 and older npm contain |
Seems that all modules from ember-source end up missing from
/assets/my-app.js
and the build fails with errors like these:I understand that's a pretty vague error description, so maybe someone familiar with the source code could provide some pointers as to what to check, e.g. where this list of modules in my-app.js gets created, so that I can start debugging from there.
Thanks.
compat build, require('@embroider/compat').compatBuild(app, Webpack);
ember-source: 4.3.0-alpha.3
ember-cli: 4.2.0-beta.1
node: 14.16.1
os: win32 x64
The text was updated successfully, but these errors were encountered: