-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Embroider crash when initializer/instance-initializer does not have a default export #277
Comments
It seems that ember-cli may not be using the default export, and it's just using the named export, but I'm not sure if the object here is the module or not. |
I don't fully understand what you mean here. Are you saying that in I believe these are related references: |
I was totally wrong here. the function is called in both. The difference seems to be that when the default export is missing, with regular ember builds,
So it doesn't cause a crash while registering the initializers. With Embroider, maybe |
I've made simple repro here (see commit history): https://github.com/mehulkar/embroider-initializer-crash. The easiest workaround is to just add the default exports into my initializers, but I think |
Right, you are describing the same thing that is described in the issues I linked in my initial comment. If you use the flag to disable the default export munging in |
How do I use this flag? I looked ovr that issue but don't see how to do it from the standpoint of ember-cli. Not sure where loader.js gets invoked. |
If you have an initializer that does not have a default export:
resolveInitializer
crashes here:ember-load-initializers/addon/index.ts
Lines 15 to 16 in b69de85
This function only seems to be called when I enable Embroider builds, not in regular ember-cli builds, so I'm not sure if this is intentional or what the expectations are.
ember-cli could be stricter and require this default export, but if it's intentional to not require the default export, then
resolveInitializer
should handle this case as well?The text was updated successfully, but these errors were encountered: