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

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

Closed
NullVoxPopuli opened this issue Aug 31, 2023 · 5 comments · Fixed by #939
Closed

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

NullVoxPopuli opened this issue Aug 31, 2023 · 5 comments · Fixed by #939

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Aug 31, 2023

Uncaught ReferenceError: Ember is not defined

This code:
image

Repro:

Here is the code to fix:

var _Ember = require.has('ember') ? require('ember').default : Ember;

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
@mkszepp
Copy link

mkszepp commented Sep 4, 2023

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 #924

NullVoxPopuli added a commit to NullVoxPopuli/ember-page-title that referenced this issue Oct 27, 2023
NullVoxPopuli added a commit to NullVoxPopuli/ember-page-title that referenced this issue Oct 28, 2023
NullVoxPopuli added a commit to NullVoxPopuli/ember-page-title that referenced this issue Oct 28, 2023
@simonihmig
Copy link
Contributor

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...

@villander
Copy link
Contributor

#924 (comment)

@IgnaceMaes
Copy link

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 🤔

@raido
Copy link

raido commented Apr 30, 2024

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

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

Successfully merging a pull request may close this issue.

6 participants