-
Notifications
You must be signed in to change notification settings - Fork 2.3k
"angular never provided resumeBootstrap" pops up #2473
Comments
I've seen this issue when manually bootstrapping, but haven't encountered it with |
Setting |
It's really hard to say anything without more info or something repeatable that I can debug. Please let me know if you find anything more we can use to investigate. |
I get this error message, too. The ng-app directive is in the body element. So everything should work normally. For more information about my problem, please see http://stackoverflow.com/questions/32719042/angular-never-provided-resumebootstrap Thanks in advance for helping! |
@juliemr @chrilehner90 @davideast I think the snyc with angular is not ok. I can't use protractor to test my app. I always get this error: Failed: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability\nhttp://errors.angularjs.org/1.4.5/ng/test" In real life applications need often to get some API data before they will run. In my case I need some API data before the app is in the configuration phase. For that reason I created a simple script which requests the API data, before angular and the app is loaded. If I have the results from the API I load angular and the app files which are merged within one file -> merged with requires js. I set the window name to window.name = 'NG_DEFER_BOOTSTRAP!'; and call the angular.resumeBootstrap. I think this should be supported by protractor. If I got this right, setting the name causes angular to pause bootstrapping the application until the resume function is called. If I start a protractor test the application loads directly and is already showing up. But I still get the error -> Failed: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability\nhttp://errors.angularjs.org/1.4.5/ng/test" And I have a ng-app attribute within my html file. I think there is something going wrong within protractor. How can it be that the page is already rendered before I get this error? I tried a browser.sleep() and also a browser.waitForAngular(); |
This might not be the solution to everyone's problems, but if you're using Browsersync, read on. Solution: Add Background: Browsersync (>=2.7.11) restores your scroll position when it refreshes and it stores that information in one of two places - Unfortunately, Protractor uses an Angular feature called Deferred Bootstrap that uses
If Browsersync overwrites that Telling Browsersync to use a cookie instead of window.name resolves the conflict. |
Well, this could be the problem in our case! |
@benjaminkitt Thanks for your solution, but I think there is something buggy in protractor. I changed my grunt release processes to remove requirejs and I changed the way how the application gets loaded. Now the application gets automatically bootstraped by angualr without resumeBootstrap. And I still don't get the tests to work if sync is enabled. Now protractor keeps telling that it can't find the ng-app, but I have one in my html file now. I believe it has some thing to do with the implementation of protractor. I also installed some chrome add-ons for testing my app. Some of them are working fine and reconize my app others of them are not able to find my app. For me its looks like the same issues. |
@benjaminkitt after hours of searching why e2e sometimes fails (3 of 9 tries) with the message "angular never provided resumeBootstrap" I found your hint "scrollRestoreTechnique: cookie" and ... BINGO it has solved my e2e test troubles. THANK YOU! |
@cyberflohr Glad it helped! Happily, BrowserSync's @shakyShane has fixed this issue in BrowserSync 2.9.11. See BrowserSync/browser-sync#808 |
I had the same issue, updating browser-sync solved the problem for me too. |
I am getting the same issue - manual bootstrap - angular 1.2.x, protractor 2.x. I am not using browser-sync.
when I set |
Same error message and issue than @aaani, using protractor 3.2.2 and angular 1.2.29, and no browser-sync.
Setting app.js wrapped with:
|
Updated Protractor to 3.2.2 (also running Angular 1.2.16) and started getting the "angular never provided resumeBootstrap" as well. @aaani 's work-around of setting Note: also using manual bootstrapping |
For information, as stated in #3115, rolling back to protractor 3.1.1 resolved this issue. |
Downgrading to Protractor 3.1.1 also solved this for me. |
This issue is kind of a conglomeration of a bunch of old issues over time. I don't think it's providing any use to keep it open. For the latest issue (which was not a flake, just happened all the time), Protractor 3.3.0 should fix it. As for the BrowserSync issues, I don't have much knowledge about this and hope that their update helps. If you are seeing a specific new issues with the latest protractor, please open up a new issue. |
Thanks @juliemr, using protractor 3.3.0 worked for me. |
I got the same problem. The error "angular never provided resumeBootstrap" randomly occurred. I did not change the angular and protractor version, and this problem just happened since some day. Perhaps some changes in my page caused this. I tried:
|
Since some time we occasionally see "angular never provided resumeBootstrap" in our tests and can't figure out why. We have
ng-app
on<html>
and use the latest stable version of Angular1.2.x
and the latest version of Protractor with Jasmine 1.I can't really give more information, because it happens very randomly. We don't do manually bootstrapping or something like that. It worked without flaws for a while.
The text was updated successfully, but these errors were encountered: