ember-cli-fastboot icon indicating copy to clipboard operation
ember-cli-fastboot copied to clipboard

App won't boot, accessing import which doesn't exist, 'ember'

Open NullVoxPopuli opened this issue 2 years ago • 3 comments

Uncaught ReferenceError: Ember is not defined

This code: image

Repro:

  • https://github.com/universal-ember/ember-primitives/pull/55
  • pnpm i
  • pnpm build
  • pnpm start
  • visit http://localhost:5001

Here is the code to fix: https://github.com/ember-fastboot/ember-cli-fastboot/blob/ddbfeb36c14001c79527f1d1ca64b4f594a1bf91/packages/ember-cli-fastboot/vendor/experimental-render-mode-rehydrate.js#L4

The questions:

  • for Ember that no longer provides global Ember, v4+, how should it be referenced?
    • all the AMD stuff is private API
    • Providing "The Ember global" is too much api surface area, because the above code doesn't need access to all that much

NullVoxPopuli avatar Aug 31 '23 02:08 NullVoxPopuli

i was running into the same error today...

while looking the issues, i have found out, that there exists an other issue which has noted the same lines https://github.com/ember-fastboot/ember-cli-fastboot/issues/924

mkszepp avatar Sep 04 '23 09:09 mkszepp

Just stumbled upon this. I assume this happening only when running under Embroider?

In this case you can workaround this by setting staticEmberSource: false. Then that AMD require stuff should be working again...

simonihmig avatar Dec 17 '23 10:12 simonihmig

https://github.com/ember-fastboot/ember-cli-fastboot/issues/924#issuecomment-1974049187

villander avatar Mar 01 '24 23:03 villander

Just ran into this as well.

Just stumbled upon this. I assume this happening only when running under Embroider?

In this case you can workaround this by setting staticEmberSource: false. Then that AMD require stuff should be working again...

Setting this flag does indeed resolve the issue. I wonder what changes are needed to have support for static Ember source 🤔

IgnaceMaes avatar Mar 16 '24 19:03 IgnaceMaes

+1 to this. Hit this after upgrading from embroider/test-setup v2.x to v4.x.

raido avatar Apr 30 '24 08:04 raido