Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular js 1.6.9 tests Unknown provider: $$taskTrackerFactoryProvider

My project is forced to be in 1.6.9 due to regression risks (for example, lowercase is obsolete in 1.7).

But recently, I made a npm update and all my karma/phantomjs tests are failing, giving

PhantomJS 2.1.1 (Windows 7.0.0)
Error: [$injector:unpr] Unknown provider: $$taskTrackerFactoryProvider <- $$taskTrackerFactory <- $browser <- $rootScope <- $browser
http://errors.angularjs.org/1.6.9$injector/unpr?p0=%24%24taskTrackerFactoryProvider%20%3C-%20%24%24taskTrackerFactory%20%3C-%20%24browser%20%3C-%20%24rootScope%20%3C-%20%24browser in C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify (line 8627)
c:/Users/XXX/AppData/Local/angular/angular.js:4887:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8627:86
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
c:/Users/XXX/AppData/Local/angular/angular.js:4892:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8632:48
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
injectionArgs@c:/Users/XXX/AppData/Local/angular/angular.js:5072:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8812:68
invoke@c:/Users/XXX/AppData/Local/angular/angular.js:5098:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8838:31
c:/Users/XXX/AppData/Local/angular/angular.js:4893:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8633:43
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
injectionArgs@c:/Users/XXX/AppData/Local/angular/angular.js:5072:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8812:68
invoke@c:/Users/XXX/AppData/Local/angular/angular.js:5098:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8838:31
$get@c:/Users/XXX/AppData/Local/angular/angular.js:4972:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8712:49
invoke@c:/Users/XXX/AppData/Local/angular/angular.js:5106:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8846:24
c:/Users/XXX/AppData/Local/angular/angular.js:4893:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8633:43
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
$$cleanup@c:/Users/XXX/AppData/Local/angular-mocks/angular-mocks.js:3281:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:3282:36
$$afterEach@c:/Users/XXX/AppData/Local/angular-mocks/angular-mocks.js:3253:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:3254:23

My package.json (I removed proprietary modules) :

{
  "name": "XXX",
  "code": "XXX",
  "version": "1.0.0",
  "description": "XXX",
  "author": {
    "name": "XXX"
  },
  "devDependencies": {
    "angular-mocks": "^1.5.5",
    "browserify": "^13.3.0",
    "browserify-shim": "^3.8.12",
    "gulp": "^3.9.1",
    "yargs": "^6.0.0"
  },
  "dependencies": {
    "angular": "1.6.9",
    "angular-animate": "^1.5.5",
    "angular-sanitize": "~1.3.16",
    "angular-translate": "^2.7.0",
    "angular-ui-bootstrap": "^2.1.0",
    "angular-ui-router": "^0.3.0",
    "ng-device-detector": "^4.0.3"
  }
}

Switching to 1.7.3 corrects the tests problem, but my website doesn't work and will need a full non regression tests when I will resolve the first obsolescence problem

A quick search with poor results showed that taskTrackerFactoryProvider appeared July 13th in angular js, but a npm update and build/tests worked well on July 24th...

I would like to know which module might call an angular js 1.7 functionality although I mentionned I needed to work with angular js 1.6 in my package.json

like image 399
Goufalite Avatar asked Aug 10 '18 14:08

Goufalite


1 Answers

Found it, it was angular-mocks. Forced it to version 1.6.9 and all works well

I am chockedsurprised that npm couldn't manage dependencies between them especially when a dep needs a specific functionnality from another...

like image 192
Goufalite Avatar answered Oct 21 '22 12:10

Goufalite