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

Removal of modules polyfill for ember-source 3.27+ breaks production builds for all apps using registerWaiter #406

Closed
runspired opened this issue May 11, 2021 · 3 comments

Comments

@runspired
Copy link
Contributor

Offending imports:

import { registerWaiter, unregisterWaiter } from '@ember/test';

These imports are missing in non-test env production builds leading the build to break. This includes all versions of EmberData, meaning that a large share of apps running ember-source 3.27 are unable to ship to production

I believe this worked prior to 3.27 because the transformation of registerWaiter to Ember.registerWaiter meant no import was present, and therefore registerWaiter being undefined did not break anything as apps typically wrap usage of it in if (DEBUG) {} or if (Ember.testing) {}.

@runspired runspired changed the title Removal of modules polyfill breaks production builds for all apps using registerWaiter Removal of modules polyfill for ember-source 3.27+ breaks production builds for all apps using registerWaiter May 11, 2021
@runspired
Copy link
Contributor Author

The source of the error is this build step here: https://github.com/emberjs/ember.js/blob/master/lib/index.js#L225-L228

Which filters all ember-testing paths out of the build. @ember/test remains in the build but when accessed will fail because it re-exports from ember-testing https://github.com/emberjs/ember.js/blob/master/packages/%40ember/test/index.js#L1-L11

@rwjblue
Copy link
Member

rwjblue commented May 28, 2021

I think this was fixed by emberjs/ember.js#19540, but happy to reopen if that is incorrect.

@rwjblue rwjblue closed this as completed May 28, 2021
@allthesignals
Copy link

allthesignals commented Feb 24, 2023

Not sure why but even even on 3.28.11 of ember-source, I'm still seeing this issue:

allthesignals/labs-zola@74ed883

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

No branches or pull requests

3 participants