Typescript transpile issue

Any one seen this and knows a solution?

typescript 2.0.3
ionic-cli 2.1.0
ionic RC.1

ionic serve


[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 24

            All declarations of 'size' must have identical modifiers.
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 30

            All declarations of 'prototype' must have identical modifiers.
      L30:  declare var WeakMap: WeakMapConstructor;
            All declarations of 'prototype' must have identical modifiers.
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 44

      L43:  new <T>(values?: T[]): Set<T>;
      L44:  readonly prototype: Set<any>;
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 54

            All declarations of 'size' must have identical modifiers.
      L54:  interface WeakSetConstructor {
      L55:      new (): WeakSet<any>;
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 60
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 73

            All declarations of 'prototype' must have identical modifiers.
            All declarations of 'prototype' must have identical modifiers.
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 17

            Duplicate identifier 'PropertyKey'.
      L16:  * Returns the index of the first element in the array where predicate is true, an
      L17:  * otherwise.
      L18:  * @param predicate find calls predicate once for each element of the array, in as
            All declarations of 'EPSILON' must have identical modifiers.
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 216

     L216:  /**
     L217:    * Returns a Boolean value that indicates whether a value is the reserved value Na
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 251

            All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers.
     L251:  * Converts A string to an integer.
     L252:  * @param s A string to convert into a number.
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 258

            All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers.
     L257:      parseInt(string: string, radix?: number): number;
     L258:  }
            All declarations of 'flags' must have identical modifiers.
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 403

     L402:  interface RegExpConstructor {
     L403:      new (pattern: RegExp, flags?: string): RegExp;
     L404:      (pattern: RegExp, flags?: string): RegExp;
            All declarations of 'value' must have identical modifiers.
      L28:  interface Array<T> {
      L29:      /** Iterator */
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.iterable.d.ts, line: 29

      L30:      [Symbol.iterator](): IterableIterator<T>;
[12:34:25]  typescript: node_modules/typescript/lib/lib.es2015.promise.d.ts, line: 69

            All declarations of 'prototype' must have identical modifiers.
      L69:  * Creates a Promise that is resolved with an array of results when all of the provi
      L70:  * resolve, or rejected when any Promise is rejected.
            Duplicate identifier 'PropertyKey'.
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 8

       L8:  interface IterableShim<T> {
            All declarations of 'value' must have identical modifiers.
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 12

      L12:  "_es6-shim iterator_"(): Iterator<T>;
            All declarations of 'EPSILON' must have identical modifiers.
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 250

     L249:    * @param number A numeric value.
     L250:    */
     L251:  isFinite(number: number): boolean;
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 285

            All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers.
     L285:  MIN_SAFE_INTEGER: number;
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 292

            All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers.
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 348

            All declarations of 'flags' must have identical modifiers.
     L347:    * @param x A numeric expression.
     L348:    */
     L349:  clz32(x: number): number;
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 500

            All declarations of 'prototype' must have identical modifiers.
     L499:   * and a reject callback used to reject the promise with a provided reason or error.
     L500:   */
     L501:  new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?:
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 563

            All declarations of 'size' must have identical modifiers.
     L562:  interface MapConstructor {
     L563:      new <K, V>(): Map<K, V>;
     L564:      new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
            All declarations of 'prototype' must have identical modifiers.
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 572

     L571:  add(value: T): Set<T>;
     L572:  clear(): void;
     L573:  delete(value: T): boolean;
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 583

            All declarations of 'size' must have identical modifiers.
     L582:  interface SetConstructor {
     L583:      new <T>(): Set<T>;
     L584:      new <T>(iterable: IterableShim<T>): Set<T>;
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 592

            All declarations of 'prototype' must have identical modifiers.
     L591:  delete(key: K): boolean;
     L592:  get(key: K): V;
     L593:  has(key: K): boolean;
            All declarations of 'prototype' must have identical modifiers.
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 607

     L606:  add(value: T): WeakSet<T>;
     L607:  delete(value: T): boolean;
     L608:  has(value: T): boolean;
            All declarations of 'prototype' must have identical modifiers.
[12:34:25]  typescript: typings/browser/ambient/es6-shim/index.d.ts, line: 621

     L620:  function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>):
     L621:  function construct(target: Function, argumentsList: ArrayLike<any>): any;
     L622:  function defineProperty(target: any, propertyKey: PropertyKey, attributes: Property
[12:34:25]  transpile failed

I had some kind of similar problem. Your real error is already scrolled over. I used:

ionic serve | more to see the first error.

The error was it couldn’t find my templates. A fix is described here: https://github.com/driftyco/ionic-app-scripts/issues/167

ye the template path issue during transpiling was fixed. the typescript errors don’t seem to be the same issue.

I have the same problem. Has anyone found a solution?

I found the problem for me.

I still had a typings.json and a typings-Folder in my app from beta-times. Didn’t do anything in RC.0 but in RC.1 it produced this error.

See the details here from the chancelog of RC.0:

Typings:

Any type definitions for third party libraries that are included via the typings tool and are included in the the typings.json file should be updated to use npm @types. An example of how this looks is:

npm install @types/lodash --save-dev --save-exact
Delete the typings.json file, and the typings directory.

1 Like

@Grischa removing typings directory solved duplicate export errors in localforage when using ionic serve (strangely, it compiled and worked in device).

Many thanks !

There is the following config in typings.json

{
  "dependencies": {},
  "devDependencies": {},
  "ambientDependencies": {
    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654"
  }
}

Is the typings folder still relevant though?

That’s exactly what I had. After removing typings.json and the typings folder my problem were gone.

BTW: I then had the problem that the newest XCODE_Version complained to not find typings.json (well yes, I deleted it). Since I could not get rid of that error I
used:

ionic platforms remove ios
ionic platforms add ios

to recreate the IOS-project. Then that problem was gone as well.

1 Like

Adding files into tsconfig.json’s excludes also seems to work.

I am using Ionic RC1 and using @types.I do not have typings directory or typings.json file. I still face the above issue with transpile when I build Ionic 2 project. Any idea how can I solve this?