skyrocket-original
skyrocket-original copied to clipboard
Importing `ember-runtime` causes imports everywhere to fail.
To reproduce:
clone the repo, npm install && bower install, run ember test.
You'll see a series of errors related to importing missing modules.
All you need to do to make all the tests except one (the one which imports the module that imports ember-runtime) pass is open index.js and comment out the thing the import of ember-runtime.
Ping @rwjblue.
Data Point:
you get the same results if u run ember serve and comment out line 92490 of dist/assets/vendor.js, aka, ;module.exports = Ember; - then visit localhost:4200/tests (without removing ember-runtime) - this must be be b/c the cjs build is being used, not the normal ember.debug.js build(they only differ in this one single line as well)
another data point: add .default to the end of this line when requiring ember in the node test setup and the init method in ember’s application.js is called right away - don’t put default on the end, and use cjs build's global module.exports = Ember line(which i mention above gives the same result as @runspired's hack for removing ember-runtime) to create an application like here in the node test setup and you gain control back over the initialization process, including ability to add initializers outside of build time(for say fastboot and maybe workers, need to read this codebase now). I explain this 2nd data point only to give another example of where the Ember global is needed, for internal testing of ember itself, but is derives from the real world usage of ember outside of a normal dom context.
Hopefully this may help @rwjblue with @runspired's question, at the very least. And perhaps give @tomdale more context with this pr im playing with with - where the node tests depend on the module.exports = Ember line that throws in your tests setup (unless you remove ember-runtime) - https://github.com/emberjs/ember.js/pull/12733