TS1219 Experimental support for decorators is a feature that is subject to change in a future release


                                  Angular 2


When we compile the  angular 2 application , most of the time we got the following error like




Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

As we know ,when we  run the Angular 2 application , the typescript compiler 'tsc' get called to execute the typescript(.ts) file. We configure the tsconfig.json file to configure the tsc compiler .

Generally the settings of the tsconfig.json file is

  {
  "compilerOptions": {
    "target": "es6",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main.d.ts",
    "typings/main"
  ]
}

Solutions :

So to fix the above issue we need to set the "experimentalDecorators" to "true" and finally the the configuration settings will be like this

{
  "compilerOptions": {
    "target": "es6",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main.d.ts",
    "typings/main"
  ]
}

Hope this will be helpful.



Please Please have some comments if it is helpful . Thanks in advance.


Comments

Popular posts from this blog

The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

The transaction is aborted or Failure while attempting to promote transaction.

Unable to load one or more breakpoints in Visual studio.