Error : Cannot read property isSkipself of null -

2019-09-15 12:08发布

问题:

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 :

回答1:

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() {
    ...
}


回答2:

Answering my own question:

Removing Router from directive. solved my problem



回答3:

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