Please provide us with the following information:
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
10
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.22-1
node: 6.2.1
os: win32 x64
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
Created with Angular CLI. I recently updated the angular version and angular-cli version
Normally this include a stack trace and some more information.
`ng serve
can't resolve module @angular/core/src/di/opaque_token from C:\Users\Luca\dev\taboozy\src\index.ts
Cannot read property 'parse' of undefined
TypeError: Cannot read property 'parse' of undefined
at ReflectorHost.normalizeAssetUrl (C:\Users\Luca\dev\taboozy\node_modules\@angular\compiler-cli\src\reflector_host.js:54:43)
at ReflectorHost.findDeclaration (C:\Users\Luca\dev\taboozy\node_modules\@angular\compiler-cli\src\reflector_host.js:151:33)
at StaticReflector.initializeConversionMap (C:\Users\Luca\dev\taboozy\node_modules\@angular\compiler-cli\src\static_reflector.js:145:38)
at new StaticReflector (C:\Users\Luca\dev\taboozy\node_modules\@angular\compiler-cli\src\static_reflector.js:42:14)
at AotPlugin._setupOptions (C:\Users\Luca\dev\taboozy\node_modules\@ngtools\webpack\src\plugin.js:137:27)
at new AotPlugin (C:\Users\Luca\dev\taboozy\node_modules\@ngtools\webpack\src\plugin.js:37:14)
at Object.exports.getWebpackNonAotConfigPartial (C:\Users\Luca\dev\taboozy\node_modules\angular-cli\models\webpack-build-typescript.js:20:13)
at new NgCliWebpackConfig (C:\Users\Luca\dev\taboozy\node_modules\angular-cli\models\webpack-config.js:23:42)
at Class.exports.default.Task.extend.run (C:\Users\Luca\dev\taboozy\node_modules\angular-cli\tasks\serve-webpack.js:20:22)
at C:\Users\Luca\dev\taboozy\node_modules\angular-cli\commands\serve.js:102:26
at process._tickCallback (internal/process/next_tick.js:103:7)`
I upgraded from version 1.0.0-beta.19 and upgrade angular version from 2.1.1 to 2.3
Thanks! We'll be in touch soon.
this error occurs because index.ts file is almost overwritten or empty.. check that!
to solve it just use.. ng init
Then, overwrite every thing except any component files u need.
I tried that - It didn't fix anything
Then try .. to remove all node_modules in ur project. then:
npm i npm --save
I tried that as well :(
npm -v
3.9.5
Hello, I am also facing the same issue , when I upgraded angular from 2.1.0 to 2.3.1 . I did this by updating the package.json manually to the version 2.3.1 for the angular packages
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"@angular/upgrade": "^2.3.1",
Can you please help resolve?
ng --version
angular-cli: 1.0.0-beta.22-1
node: 6.8.1
os: win32 x64
I get the same error using 2.3.1 but only if i do a aot build using the cli, which previously worked, without aot it works.
Hi, I am also getting the same error after upgrading from Angular 2.2.x to 2.3.1. I upgraded with npm update --save
angular-cli: 1.0.0-beta.22-1
node: 6.6.0
os: win32 x64
Im getting this as well.
I temporarily fixed this by downgrading:
"@angular/common": "2.2.2",
"@angular/compiler": "2.2.2",
"@angular/compiler-cli": "2.2.2",
"@angular/core": "2.2.2",
"@angular/forms": "2.2.2",
"@angular/http": "2.2.2",
"@angular/platform-browser": "2.2.2",
"@angular/platform-browser-dynamic": "2.2.2",
"@angular/router": "3.2.1",
"angular-cli": "1.0.0-beta.21" // LOCAL AND GLOBAL
Same issue here after upgrade
Angular 2.3.x is not supported, up to v1.0.0-beta.23
+1 Same issue here after upgrade
It seems angular-cli 1.0.0-beta.22+ not supporting angular 2.3+; I think this issue will be fixed in next updates, so until that time, in package.json, reset all angular dependencies to be as the following
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",
"@angular/core": "~2.2.0",
"@angular/forms": "~2.2.0",
"@angular/http": "~2.2.0",
"@angular/platform-browser": "~2.2.0",
"@angular/platform-browser-dynamic": "~2.2.0",
then,
npm i npm --save
I'm having the problem also, and it's not 2.20. I reset my @angular as suggested, and that didn't solve it. Must be something else!
"dependencies": {
"@angular/common": "^2.2.3",
"@angular/compiler": "^2.2.3",
"@angular/core": "^2.2.3",
"@angular/forms": "^2.2.3",
"@angular/http": "^2.2.3",
"@angular/platform-browser": "^2.2.3",
"@angular/platform-browser-dynamic": "^2.2.3",
"@angular/router": "^3.1.1",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.15",
"@types/lodash": "^4.14.37",
"angular2-datatable": "0.5.2",
"angular2-toaster": "1.1.0",
"chart.js": "^2.4.0",
"core-js": "^2.4.1",
"moment": "^2.17.1",
"ng2-bootstrap": "^1.1.16",
"ng2-charts": "^1.4.4",
"ng2-file-upload": "^1.1.4-2",
"rxjs": "5.0.1",
"ts-helpers": "^1.1.2",
"zone.js": "0.7.3"
},
"devDependencies": {
"@types/jasmine": "^2.5.35",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.19-3",
"angular2-moment": "^1.0.0",
"awesome-typescript-loader": "^3.0.0-beta.17",
"codelyzer": "1.0.0-beta.2",
"jasmine-core": "^2.5.2",
"jasmine-spec-reporter": "2.7.0",
"karma": "1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"moment": "^2.16.0",
"protractor": "4.0.9",
"pug": "^2.0.0-beta6",
"pug-cli": "^1.0.0-alpha6",
"ts-node": "1.7.0",
"tslint": "^3.15.1",
"webdriver-manager": "10.2.10"
}
Last Angular release 2.4.1 and Angular-cli 1.0.0-beta.24
it work fine.
Ps. 4.00 is coming....
When I try Angular 2.4.1 and ng-cli 1.0.0-beta.24 I get a new error:
patterns.map is not a function
TypeError: patterns.map is not a function
at GlobCopyWebpackPlugin.apply (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/plugins/glob-copy-webpack-plugin.js:16:29)
at Compiler.apply (/Users/pol/Dev/coach/rambutan/node_modules/tapable/lib/Tapable.js:270:16)
at WebpackOptionsApply.process (/Users/pol/Dev/coach/rambutan/node_modules/webpack/lib/WebpackOptionsApply.js:59:18)
at webpack (/Users/pol/Dev/coach/rambutan/node_modules/webpack/lib/webpack.js:28:48)
at Class.run (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/tasks/build-webpack.js:19:31)
at Class.run (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/commands/build.js:60:26)
at Class.<anonymous> (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/ember-cli/lib/models/command.js:152:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
@redaikidoka see here https://github.com/angular/angular-cli/issues/3566 to solve your problem.
Fixed in latest beta.
angular-cli: 1.0.0-beta.24
node: 6.9.1
os: darwin x64
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/router: 3.3.1
results:
patterns.map is not a function
TypeError: patterns.map is not a function
at GlobCopyWebpackPlugin.apply (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/plugins/glob-copy-webpack-plugin.js:16:29)
at Compiler.apply (/Users/pol/Dev/coach/rambutan/node_modules/tapable/lib/Tapable.js:270:16)
at WebpackOptionsApply.process (/Users/pol/Dev/coach/rambutan/node_modules/webpack/lib/WebpackOptionsApply.js:59:18)
at webpack (/Users/pol/Dev/coach/rambutan/node_modules/webpack/lib/webpack.js:28:48)
at Class.run (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/tasks/build-webpack.js:19:31)
at Class.run (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/commands/build.js:60:26)
at Class.<anonymous> (/Users/pol/Dev/coach/rambutan/node_modules/angular-cli/ember-cli/lib/models/command.js:152:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
Samething here, however I am using angular-cli": "1.0.0-beta.25.5 and I added "assets":["assets"], and got other errors.
ERROR in ./src/app/shared/forms/input/select2/select2.directive.ts
Module not found: Error: Can't resolve 'script' in 'web/src/app/shared/forms/input/select2'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
You need to specify 'script-loader' instead of 'script'.
When I run ng build I get:
`
ERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'imports' in '/web/src'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
You need to specify 'imports-loader' instead of 'imports'.
@ ./src/polyfills.ts 28:0-60
@ ./src/main.ts
@ multi main
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
It seems angular-cli 1.0.0-beta.22+ not supporting angular 2.3+; I think this issue will be fixed in next updates, so until that time, in package.json, reset all angular dependencies to be as the following
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",
"@angular/core": "~2.2.0",
"@angular/forms": "~2.2.0",
"@angular/http": "~2.2.0",
"@angular/platform-browser": "~2.2.0",
"@angular/platform-browser-dynamic": "~2.2.0",
then,
npm i npm --save