ES6-shim from Angular2 conflicts with Typescript lib.es6.d.ts

I want to compile my Angular2 application written in Typescript in planning ES6 code to compile it in ES5 recently using Babel. But I get an error message:

node_modules/angular2/typings/es6-shim/es6-shim.d.ts(6,14): error TS2300: Duplicate identifier 'PropertyKey'.
<...>
node_modules/typescript/lib/lib.es6.d.ts(3841,14): error TS2300: Duplicate identifier 'PropertyKey'.
<...>

I tried to solve this problem by adding a directive noLibto mine tsconfig.json, but one of the angular files ( zone.d.ts) should import es6-shim.d.tsusing

/// <reference path="es6-shim/es6-shim.d.ts" />

and it conflicts with the Typescript ES6 ( lib.es6.d.ts) core library .

How can I solve this problem?

+4
source share
1 answer

Have you tried this in your tsconfig.json ?:
  { "compilerOptions": { "target": "ES6" } }

btw, babel, typescript? , . typescript, typescript js, , . , es5 es6, es6, , es6 , , es6.

+1

Source: https://habr.com/ru/post/1623554/


All Articles