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

Fix use of Ember global, breaking Ember 4 #849

Merged
merged 2 commits into from
Sep 10, 2021

Conversation

simonihmig
Copy link
Contributor

I think it's not ideal to rely on assumptions about the global require() and AMD-style modules, especially in a brave new Embroider world. But after all this is what the RFC706 suggests in the drawbacks section, and should be good enough to fix this for the short term...

Fixes #827

@simonihmig
Copy link
Contributor Author

Somehow, the first attempt (first commit) of using just require('ember').default didn't work in Ember 3.26 (CI was failing), as that threw an error that the module is not defined (require.entries was an empty object), but it did work for 3.27 and 4.0 (tested locally)! 🤔

The fallback check in the 2nd commit fixes this. But given we don't test across Ember versions in CI yet, the confidence in this change is somewhat lower than I would want. Maybe we have to wait for #848 first?

Copy link
Contributor

@snewcomer snewcomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 💯. This will fix it!

@snewcomer
Copy link
Contributor

@rwjblue rwjblue merged commit f9b5f2a into ember-fastboot:master Sep 10, 2021
@rwjblue rwjblue added the bug label Sep 10, 2021
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 this pull request may close these issues.

Use of Ember global triggers deprecation / fails for Ember 4
3 participants