Linux
angular-cli: 1.0.0-beta.22
node: 7.2.0
os: linux x64
I was able to reproduce the issue using a completely new project, using 1.0.0-beta.22
ng new testproj
cd testproj
npm test
$ ng test
ngtools.PathsPlugin is not a constructor
TypeError: ngtools.PathsPlugin is not a constructor
at getWebpackTestConfig (/home/maistho/prog/testproj/node_modules/angular-cli/models/webpack-build-test.js:63:9)
at init (/home/maistho/prog/testproj/node_modules/angular-cli/plugins/karma.js:21:25)
at Array.invoke (/home/maistho/prog/testproj/node_modules/di/lib/injector.js:75:15)
at Injector.get (/home/maistho/prog/testproj/node_modules/di/lib/injector.js:48:43)
at /home/maistho/prog/testproj/node_modules/karma/lib/server.js:143:20
at Array.forEach (native)
at Server._start (/home/maistho/prog/testproj/node_modules/karma/lib/server.js:142:21)
at Injector.invoke (/home/maistho/prog/testproj/node_modules/di/lib/injector.js:75:15)
at Server.start (/home/maistho/prog/testproj/node_modules/karma/lib/server.js:103:18)
at /home/maistho/prog/testproj/node_modules/angular-cli/tasks/test.js:33:25
at Class.run (/home/maistho/prog/testproj/node_modules/angular-cli/tasks/test.js:15:16)
at Class.run (/home/maistho/prog/testproj/node_modules/angular-cli/commands/test.js:31:25)
at Class.<anonymous> (/home/maistho/prog/testproj/node_modules/angular-cli/angular-cli/lib/models/command.js:152:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
It seems that my @ngtools/webpack is at version 1.1.6, and not 1.1.8, which is the newest version.
cat node_modules/@ngtools/webpack/package.json
Running npm view @ngtools/webpack shows me that 1.1.8 is tagged as 'experimental'. I'm assuming that 1.1.7 or 1.1.8 introduced the PathsPlugin, which seems likely since it was introduced only 9 days ago.
Also, if angular-cli is now depending on the version of @ngtools/webpack to be at least 1.1.8, maybe that should be updated here?
Updating package.json and running npm update solves it. This confirms that there is a version resolution issue.
Added to devDependencies of package.json:
"@ngtools/webpack": "^1.1.8",
Experimental releases are to use at your own risk. Right now Beta 22 is experimental.
Uh.. aren't they all experimental - they're all beta. So how are we expected to use it??
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Experimental releases are to use at your own risk. Right now Beta 22 is experimental.