-
Notifications
You must be signed in to change notification settings - Fork 142
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
Current incompatibly with ember-data #946
Comments
Update: I believe ember-data no longer correctly respects [Proposed Fix] -> The following PR to ember-data fixes the issue locally for both classic and embroider builds emberjs/data#7680 |
…#7527) * disable modules polyfills when transpiling for rollup * implement fix * fix lint * fix expansion * better comment
@ef4 I am surprised embroider's tests don't catch this. I suspect we are missing some coverage. Especially if a compat adapter isn't working as expected. |
I was using an older version of embroider in my tests. As of embroider@0.43.3 the problem is resolved. That being said, ember-data should respect the flag in question.... I will ensure my PR lands there, but this issue can be treated as resolved. |
Easy steps to reproduce:
volta install ember-cli ember new --embroider my-cool-app cd my-cool-app ember s
Now visit http://localhost:4200
You will see a blank screen, and if you open the browser console you will see:
Specifically, it appears that
Store
here is undefined. Further investigation ember-data's-private
module appears to be rolled up into some AMD modules:This is unexpected, given that I believe embroider attempts to turns off this capability of ember-data. Debugging though reveal that ember-data's treeForAddon does indeed still run. This suggests a potential issue with embroider's ember-data compatibility adapter (or embroiders general ability to disable some addon trees). (note: I will refer to this as bug number 1).
Unfortunately, the problems don't end here. Disabling ember-data's
treeForAddon
rollup behavior via it'sEMBER_DATA_ROLLUP_PRIVATE
environment variable does not solve our problem, as those ember-data has internal paths that cannot be resolved.At this point, I was a little confused. How was this ever working? My guess is that for a while, embroider's ember-data campability addon did correctly skip ember-data's treeForAddon hook, and worked correctly. Basically, it appears that although embroider thought it was disabling ember-data's rollup build, it was in-fact webpack
ability to assimilate AMD was bridging the gap.simply processingstore/-private.js
as an es6 module.So what happened? The following ember-data commit appears to be what broke the camels back. After this commit, ember-data's file was converted into AMD by the time webpack looked at it, which caused some issues. I was under the impression that webpack handled this case, but I'll dig in...
output from passing/failing variants of the
@ember-data/store/-private
file:The text was updated successfully, but these errors were encountered: