Here are the tsconfig :
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"watch": true,
"removeComments": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": false,
"noImplicitAny": false,
"noLib": false
},
getting error :
I got the same error message and it turned out I had forgotten to add @Injectable()
on top of the service I had created.
@Injectable() // <-- missing
export class MyService() {
...
}
Answering my own question:
Removing Router from directive. solved my problem
Hard to tell without seeing the code that causes it. Here are discussion about similar error messages
- https://github.com/angular/angular/issues/8519
- https://github.com/angular/angular/issues/8820
- https://github.com/angular/angular/issues/8704
Update
The error message should be improved now with https://github.com/angular/angular/issues/9332