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

"EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug." #15615

Closed
mdebbar opened this issue Aug 30, 2017 · 2 comments
Assignees

Comments

@mdebbar
Copy link

mdebbar commented Aug 30, 2017

Ember version: [email protected]

When the app runs on the server side, I’m hitting few service injection errors of this kind:

Attempting to inject an unknown injection: 'service:xyz'

After some digging with @krisselden, we found that there's an error thrown (and swallowed) earlier in EngineInstance's cloneParentDependencies() method. The error is:

EventDispatcher should never be instantiated in fastboot mode. Please report this as an Ember bug.

So here I am, reporting an Ember bug as the error told me 🙂

I did some more digging and found an explanation to the swallowing of the real error. The error happens during the boot of an engine. The engine's boot() method correctly returns a rejected promise because of that error. Then that promise is ignored and the app continues running as if nothing happened.

@mdebbar
Copy link
Author

mdebbar commented Aug 31, 2017

It seems like the issue was introduced by this commit. The event_dispatcher was moved from the registrations list to the singletons list. The difference being that registrations are only resolved at this point, but singletons are eagerly looked up and instantiated.

A possible fix would be to check if running in a server-side environment, don't add event_dispatcher:main to the singletons list.

@rwjblue
Copy link
Member

rwjblue commented Oct 3, 2017

Sorry for the delay here, but I finally got the fix submitted in #15695.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants