-
Notifications
You must be signed in to change notification settings - Fork 62
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
Attempting to inject an unknown injection: service:-document
#77
Comments
@krisselden @rwjblue Any suggestions? |
@simonihmig thanks for adding the failing test cases in ELT. I've been getting the same failures with ember-burger-menu for Ember 2.6 and 2.7. |
Any news on this one? /cc @krisselden @rwjblue As Ember 2.10 is out, we have the choice of either using ember-wormhole 0.5.1 (which has these issues with 2.6/2.7) or stick to 0.4.1 (which seems to have issues with Ember 2.10, for me at least in a Fastboot env), but apparently currently no version that runs flawlessly in all Ember versions. |
@lukemelia @offirgolan @simonihmig @anulman Actually, "service:-document" does exist in Ember 2.6 and 2.7 but in any case it is a faux service that returns window.document in the browser (and something else in Fastboot). You can get an integration test to pass by adding the following to
(I learned all this from talking to @runspired) |
@Gaurav0 OK, but that fixes the test, but not the app!? 😳 It is not an issue within tests only, it is real! |
@simonihmig If you're not using Fastboot / SSR, just add an initializer that registers service:-document the same way. If you are, right now I would just recommend upgrading to 2.8. |
The problem I have with that is that I use ember-wormhole in an addon (ember-bootstrap), as do many others (see above for references to ember-light-table, ember-burger-menu, ember-basic-dropdown). Won't add an initializer there for "fixing" things in a dependency. |
Could the addon detect the ember version and only use |
@simonihmig I would recommend for your addon, until this bug is fixed, to:
|
I revisited this today...
Interestingly I could not confirm what I said here today. So basically integrations tests were failing with the mentioned exception, but I could not reproduce this in a real app... The approach @Gaurav0 mentioned here did work for fixing the tests with Ember 2.6/2.7, but threw with later versions of Ember... So I came up with #95 which should fix these problems, without anybody having to touch their tests! |
Forgot to close this. Fixed this in #95 |
Since having upgraded to ember-wormhole 0.5.1 in our Ember 2.7 based app I see this exception. Seems to be related to #75.
I saw this in one of our apps after updating ember-light-table, that brings in ember-wormhole 0.5.1. Added an ember-try config for Ember 2.7 here: adopted-ember-addons/ember-light-table#267, which is failing for 2.7 (see the Travis logs), probably also 2.6 (not tested).
Also tried to update ember-wormhole in my own addon ember-bootstrap (ember-bootstrap/ember-bootstrap#160) and see the same exception (see the Travis logs), for 2.7 and 2.6.
The stack trace is unfortunately cut off too early in the Travis logs, but when running tests in Chrome I saw the stack trace touching this line actually: https://github.com/yapplabs/ember-wormhole/blob/master/addon/utils/dom.js#L54. So it was not failing here https://github.com/yapplabs/ember-wormhole/blob/master/addon/utils/dom.js#L50,
documentService
wasundefined
as expected.Tried to reproduce this within ember-wormhole itself by adding an ember-try scenario for 2.7, however that did not fail! Strange enough...
The text was updated successfully, but these errors were encountered: