I'm starting on a new project forked from an existing Angular 1 codebase, 
with the intention of using ngUpgrade to do new development using Angular 
2. I've successfully added Angular 2 to the project, but when I try to 
instantiate ngUpgrade in order to bootstrap the ng2 side of the 
application, I get the following error:

zone.js:461 Unhandled Promise rejection: Error: [$injector:modulerr] Failed 
to instantiate module NG2_UPGRADE_0_ due to:
  Error: [$injector:unpr] Unknown provider: $$testabilityProvider
  
http://errors.angularjs.org/1.2.15-build.2399+sha.ca4ddfa/$injector/unpr?p0=%24%24testabilityProvider
      at 
http://localhost:63342/myapp/bower_components/angular/angular.js:78:12
      at 
http://localhost:63342/myapp/bower_components/angular/angular.js:3596:19
      at Object.getService [as get] 
(http://localhost:63342/myapp/bower_components/angular/angular.js:3723:39)
      at Object.decorator 
(http://localhost:63342/myapp/bower_components/angular/angular.js:3652:41)
      at eval 
(http://localhost:63342/myapp/node_modules/@angular/upgrade/src/upgrade_adapter.js:309:25)
      at 
http://localhost:63342/myapp/bower_components/angular/angular.js:3679:37
      at Array.forEach (native)
      at forEach 
(http://localhost:63342/myapp/bower_components/angular/angular.js:322:11)
      at loadModules 
(http://localhost:63342/myapp/bower_components/angular/angular.js:3666:5)
      at createInjector 
(http://localhost:63342/myapp/bower_components/angular/angular.js:3606:11)
  
http://errors.angularjs.org/1.2.15-build.2399+sha.ca4ddfa/$injector/moduler…FSSMS%2FClient%2Fapp%2Fbower_components%2Fangular%2Fangular.js%3A3606%3A11)
      at 
http://localhost:63342/myapp/bower_components/angular/angular.js:78:12
      at 
http://localhost:63342/myapp/bower_components/angular/angular.js:3700:15
      at Array.forEach (native)
      at forEach 
(http://localhost:63342/myapp/bower_components/angular/angular.js:322:11)
      at loadModules 
(http://localhost:63342/myapp/bower_components/angular/angular.js:3666:5)
      at createInjector 
(http://localhost:63342/myapp/bower_components/angular/angular.js:3606:11)
      at doBootstrap 
(http://localhost:63342/myapp/bower_components/angular/angular.js:1338:20)
      at eval 
(http://localhost:63342/myapp/node_modules/@angular/upgrade/src/upgrade_adapter.js:348:42)
      at ZoneDelegate.invoke 
(http://localhost:63342/myapp/node_modules/zone.js/dist/zone.js:323:29)
      at Object.onInvoke 
(http://localhost:63342/myapp/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)
  Error loading http://localhost:63342/myapp/ng2/main.js


I've searched for information on Failed to instantiate module 
NG2_UPGRADE_0_ and on $$testabilityProvider, but haven't been able to find 
anything useful.

It's a fairly complex project to start with, so trying to tear this down to 
a workable plunkr is challenging. Before I try to do so, is this something 
anyone has any ideas about?

Looking at the call stack, clearly the calls go from Angular 2 
(node_modules/@angular/...) into angularjs (bower_components/angular), so 
the process appears to be starting off as expected. I don't have enough of 
an understanding of ngUpgrade to troubleshoot beyond what I've done so far. 

(This is cross-posted 
from 
http://stackoverflow.com/questions/37662930/unknown-provider-error-in-ngupgrade-angular-1-2-hybrid-application.
 
I'm happy to accept a correct answer over there.) 

Hopefully someone has an idea - this has been blocking me for a couple of 
days now. 

Cheers,
Stuart 

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to