1
votes

I migrated from angular 5.2 to 6.0. When I issue the ng serve command, I get the following error:

ERROR in src/app/mappy/mappy.component.ts(1,36): error TS2305: Module '"C:/NSE911/applicationDev/angular/alo/node_modules/@angular/core/core"' has no exported member 'state'.

I am using: typescript: 2.7.2, angular cli: 6.0.1, Node: 8.11.2, OS: win32 x 64, angular: 6.0.0, rxjs-compat: "^6.1.0",

I removed the node_modules directory and re-created it again (npm install). This did not work.
I will appreciate any ideas (I am kind of new using this technologies). Thanks for any help.

3

3 Answers

5
votes

The import for "trigger, state, transition, animate, style" has changed from @angular/core to @angular/animations.

For example:

import { trigger, state, transition, animate, style } from '@angular/animations';
1
votes

I found out was was the error: import { Component, Input, OnInit, state } from '@angular/core'; After I remove the 'state' on the above import statement the problem went way. lmv

1
votes

The import for state has changed from @angular/core to @angular/animations