Ionic Build Failing

My Ionic Build is failing either on serve or a standard build. I am getting the duplicate typings messages. The projects were created with app-scripts 1.1.4.

In addition, any new project or any old project will NOT launch. So I am kind of stuck. Below is my ionic info output, although, I have tried this Node 4.8.0 (LTS) as well with the same error. I have also uninstall ionic and node completely, cleaned cache, and reinstalled. Same issue.

Any help would be greatly appreciated.

Cordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Xcode 7.2 Build version 7C46t

“The duplicate typings messages” probably means a lot more to you than it does to anybody else trying to help you. What duplicate typings messages?

15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/jasmine/index.d.ts, line: 39
’=’ expected.

  L38:  declare namespace jasmine {
  L40:      var clock: () => Clock;

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/jasmine/index.d.ts, line: 41
’=’ expected.

  L40:      var clock: () => Clock;
  L42:      function any(aclass: any): Any;

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 6

        Duplicate identifier 'PropertyKey'. 

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 10
L5: value?: T;

        All declarations of 'value' must have identical modifiers. 

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 248
L10: * Shim for an ES6 iterable. Not intended for direct use by user code.

        All declarations of 'EPSILON' must have identical modifiers. 

 L247:  * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
 L248:  * number. Only finite values of the type number, result in true.
 L249:  * @param number A numeric value.

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 283
All declarations of ‘MAX_SAFE_INTEGER’ must have identical modifiers.

 L282:  * a Number value.
 L283:  * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 290
All declarations of ‘MIN_SAFE_INTEGER’ must have identical modifiers.

 L289:    * @param string A string that contains a floating-point number.
 L291:  parseFloat(string: string): number;

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 346
All declarations of ‘flags’ must have identical modifiers.

 L346:    * Returns the number of leading zero bits in the 32-bit binary representation of a number.
 L347:    * @param x A numeric expression.

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 498

        All declarations of 'prototype' must have identical modifiers. 

 L497:  * @param executor A callback used to initialize the promise. This callback is passed two arguments:
 L498:  * a resolve callback used resolve the promise with a value or the result of another promise,
 L499:  * and a reject callback used to reject the promise with a provided reason or error.

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 561
All declarations of ‘size’ must have identical modifiers.

 L562:  interface MapConstructor {

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 570

        All declarations of 'prototype' must have identical modifiers. 

 L570:  interface Set<T> {
 L571:      add(value: T): Set<T>;

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 581

        All declarations of 'size' must have identical modifiers. 

 L580:      '_es6-shim iterator_'(): IterableIteratorShim<T>;

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 591
All declarations of ‘prototype’ must have identical modifiers.

 L591:  interface WeakMap<K, V> {
 L592:      delete(key: K): boolean;

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 606
All declarations of ‘prototype’ must have identical modifiers.

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts, line: 620
L606: interface WeakSet {
L607: add(value: T): WeakSet;

        All declarations of 'prototype' must have identical modifiers. 

 L620:  declare namespace Reflect {

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/jasmine/index.d.ts, line: 39
L621: function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any;

        A parameter initializer is only allowed in a function or constructor implementation. 

  L38:  declare namespace jasmine {

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/jasmine/index.d.ts, line: 39
L40: var clock: () => Clock;

        Cannot find name 'keyof'. 

[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/jasmine/index.d.ts, line: 41
[15:33:45] typescript: Users/jkeczan/Projects/web/internal/node_modules/@types/jasmine/index.d.ts, line: 41
L38: declare namespace jasmine {
L40: var clock: () => Clock;
[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 24

        A parameter initializer is only allowed in a function or constructor implementation. 

  L40:      var clock: () => Clock;
  L42:      function any(aclass: any): Any;

        Cannot find name 'keyof'. 

  L40:      var clock: () => Clock;
  L42:      function any(aclass: any): Any;

        All declarations of 'size' must have identical modifiers. 

  L25:  interface WeakMapConstructor {

[15:33:45] 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;

[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 44

        All declarations of 'prototype' must have identical modifiers. 

[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 54
[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 60
[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 73
L43: new (values?: T[]): Set;
L44: readonly prototype: Set;

        All declarations of 'size' must have identical modifiers. 

  L54:  interface WeakSetConstructor {
  L55:      new (): WeakSet<any>;

        All declarations of 'prototype' must have identical modifiers. 

  L59:  declare var WeakSet: WeakSetConstructor;

        All declarations of 'prototype' must have identical modifiers. 

[15:33:45] 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, and undefined

[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 216
L17: * otherwise.
L18: * @param predicate find calls predicate once for each element of the array, in ascending

        All declarations of 'EPSILON' must have identical modifiers. 

[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 251
[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 258

 L217:        * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a

        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.

        All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers. 

[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 403
L257: parseInt(string: string, radix?: number): number;

        All declarations of 'flags' must have identical modifiers. 

 L402:  interface RegExpConstructor {
 L403:      new (pattern: RegExp, flags?: string): RegExp;
 L404:      (pattern: RegExp, flags?: string): RegExp;

[15:33:45] typescript: node_modules/typescript/lib/lib.es2015.iterable.d.ts, line: 29

        All declarations of 'value' must have identical modifiers. 

  L28:  interface Array<T> {
  L29:      /** Iterator */
  L30:      [Symbol.iterator](): IterableIterator<T>;

[15:33:45] 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 provided Promises
  L70:   * resolve, or rejected when any Promise is rejected.

[15:33:45] transpile failed
[15:33:45] ionic-app-script task: “build”
[15:33:45] Error: Error

First up, you definitely need to get rid of @types/es6-shim. Secondly, you may need to change some things in tsconfig.json.

TSConfig

{
“compilerOptions”: {
“allowSyntheticDefaultImports”: true,
“declaration”: false,
“emitDecoratorMetadata”: true,
“experimentalDecorators”: true,
“lib”: [
“dom”,
“es2015”
],
“module”: “es2015”,
“moduleResolution”: “node”,
“sourceMap”: true,
“target”: “es5”
},
“include”: [
“src/**/*.ts”
],
“exclude”: [
“node_modules”
],
“compileOnSave”: false,
“atom”: {
“rewriteTsconfig”: false
}
}

Also, I am not installing @types/es6-shim. I am assuming that is being installed elsewhere. In addition, looking in my node_modules/@types scoped package, I do NOT have es6-shim at all

I finally figured this out. When I typed being installed elsewhere, my brain clicked.

Apparently, I had a mental lapse and started a project in a parent directory which also had a node_modules/.

Removing all the project code resolved the issue.

Sorry, I don’t understand what “scoped package” means, but you definitely have it:

Users/jkeczan/Projects/web/internal/node_modules/@types/es6-shim/index.d.ts

The fact that you have jasmine types leads me to believe you have unit test files. Those must be absolutely, completely, categorically excluded by tsconfig.json or you will have further problems down the road when ngc gets involved. Doing so may also help some here.

If you can’t figure out why @types/es6-shim is there, try using npm ls.