Ember version: [email protected]
When the app runs on the server side, I鈥檓 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.
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.
Sorry for the delay here, but I finally got the fix submitted in https://github.com/emberjs/ember.js/pull/15695.
Most helpful comment
Sorry for the delay here, but I finally got the fix submitted in https://github.com/emberjs/ember.js/pull/15695.