[Solved] Upgrade 3.28 to 4.x: "Ember is not defined"

Hey there,

i am upgrading an application from 3.28 to 4.0 (but the issue is also when going directly to 4.3): When starting the application itself or the qunit tests I get the errors:

Uncaught ReferenceError: Ember is not defined at http://localhost:7357/assets/vendor.js, line 72977

(the referenced line in vendor.js is actually

generateModule('ember', { default: Ember });

)

In the tests I also get

Could not find module `@ember/test-waiters` imported from `@ember/test-helpers/settled`

I am banging my head against this for hours now, but cannot find an approach how to continue. May be someone can point me on how to continue analyzing this.

Thanks in advance.

Any idea where the code in question is coming from (before it gets smashed into vendor.js, maybe try searching node_modules or your app code)? Looks like it could be framework code but if it’s your own code or an addon that might be the issue (The Ember global was deprecated in 3.x and removed in 4.0) and you’d need to update that addon or fix up the code (if yours). Did you work through all deprecations prior to trying to upgrade? What steps did you take to upgrade?

Hey thanks. I fixed all deprecations before doing the upgrade (via ember-cli). For fixing I removed a couple of plugins that weren’t supported anymore, so that until the upgrade the build was without warnings. While grepping through the dependencies I stumbled across “ember-cli-shims” which is not needed anymore caused the issue :smiley: (Now I have to fix other stuff :see_no_evil: )

Thanks for your support!

1 Like

Nice! Glad you got that issue figured out at least. Good luck with the rest of it!

1 Like