zero_coding zero_coding - 6 months ago 37
TypeScript Question

Errors appear when using rxjs in typescript

I downloaded rxjs via with following command:

npm install @reactivex/rxjs

in the folder src contains many ts files:
enter image description here

Then I copied the src folder into my project based on core as:
enter image description here

Then Visual Studio compiler complains a lot of things:
enter image description here

looks like:

"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"outDir": "../wwwroot/js"
"exclude": [

What is wrong?


You may need to target ES6 in your tsconfig.json file. tsconfig.json

"compilerOptions": {
    "target": "ES6"

Or, you may need to install a polyfill that handles Promises (and more) and has typings for Typescript, like core-js.

npm install typings core-js
typings install –global –save dt~core-js