ionic-team / ionic-app-scripts

App Build Scripts for Ionic Projects
http://ionicframework.com/
MIT License
608 stars 304 forks source link

RC5: Hundreds of Typings Errors #655

Closed brandyscarney closed 7 years ago

brandyscarney commented 7 years ago

From @queejie on January 14, 2017 2:27

Ionic version: (check one with "x") [ ] 1.x [x] 2.x

I'm submitting a ... (check one with "x") [ ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

  1. Build the app:
[21:13:00]  ionic-app-scripts 1.0.0 
[21:13:00]  watch started ... 
[21:13:00]  build dev started ... 
[21:13:00]  clean started ... 
[21:13:00]  clean finished in 3 ms 
[21:13:00]  copy started ... 
[21:13:00]  transpile started ... 
[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 21 
            Duplicate identifier 'PropertyKey'. 

      L20:  * target object. Returns the target object.
      L21:  * @param target The target object to copy to.
      L22:  * @param source1 The first source object from which to copy properties.

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 85 
            All declarations of 'name' must have identical modifiers. 

      L84:  * otherwise.
      L85:  * @param predicate find calls predicate once for each element of the array, in ascending
      L86:  * order, until it finds one where predicate returns true. If such an element is found, find

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 145 
            Subsequent variable declarations must have the same type. Variable '[Symbol.unscopables]' must be of type '{ 
            copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: ...', but 
            here has type 'any'. 

     L146:        * Creates an array from an array-like object.

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 262 
            All declarations of 'flags' must have identical modifiers. 

     L261:  * number. Only finite values of the type number, result in true.
     L262:  * @param number A numeric value.

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 276 
            All declarations of 'EPSILON' must have identical modifiers. 

     L275:  * to a number. Only values of the type number, that are also NaN, result in true.
     L276:  * @param number A numeric value.

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 311 
            All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers. 

     L310:  * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
     L311:  * All other strings are considered decimal.

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 318 
            All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers. 

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

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 457 
            Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type 
            '"Symbol"', but here has type 'string'. 

     L457:      for(key: string): symbol;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 457 
            All declarations of '[Symbol.toStringTag]' must have identical modifiers. 

     L457:      for(key: string): symbol;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 464 
            All declarations of 'prototype' must have identical modifiers. 

     L464:      keyFor(sym: symbol): string;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 492 
            All declarations of 'hasInstance' must have identical modifiers. 

     L493:        * A regular expression method that replaces matched substrings of a string. Called by the

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 498 
            All declarations of 'isConcatSpreadable' must have identical modifiers. 

     L499:        * A regular expression method that returns the index within a string that matches the

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 504 
            All declarations of 'iterator' must have identical modifiers. 

     L505:        * A function valued property that is the constructor function that is used to create

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 510 
            All declarations of 'match' must have identical modifiers. 

     L511:        * A regular expression method that splits a string at the indices that match the regular

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 516 
            All declarations of 'replace' must have identical modifiers. 

     L517:        * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 522 
            All declarations of 'search' must have identical modifiers. 

     L523:        * A String value that is used in the creation of the default string description of an object.

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 528 
            All declarations of 'species' must have identical modifiers. 

     L529:        * An Object whose own property names are property names that are excluded from the with

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 534 
            All declarations of 'split' must have identical modifiers. 

     L535:        * Non-standard. Use simple mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 540 
            All declarations of 'toPrimitive' must have identical modifiers. 

     L540:    * Non-standard. Use setter mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 546 
            All declarations of 'toStringTag' must have identical modifiers. 

     L545:  declare var Symbol: SymbolConstructor;
     L547:  interface Object {

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 552 
            All declarations of 'unscopables' must have identical modifiers. 

     L552:      hasOwnProperty(v: PropertyKey): boolean;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 609 
            Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type 
            '"Math"', but here has type 'string'. 

     L608:      size: number;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 609 
            All declarations of '[Symbol.toStringTag]' must have identical modifiers. 

     L608:      size: number;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 613 
            Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type 
            '"JSON"', but here has type 'string'. 

     L612:  new <K, V>(): Map<K, V>;
     L613:  new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
     L614:  prototype: Map<any, any>;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 613 
            All declarations of '[Symbol.toStringTag]' must have identical modifiers. 

     L612:  new <K, V>(): Map<K, V>;
     L613:  new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
     L614:  prototype: Map<any, any>;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 628 
            All declarations of 'size' must have identical modifiers. 

     L628:  interface SetConstructor {
     L629:      new <T>(): Set<T>;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 634 
            All declarations of 'prototype' must have identical modifiers. 

     L634:  declare var Set: SetConstructor;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 645 
            All declarations of 'size' must have identical modifiers. 

     L644:  new <K, V>(): WeakMap<K, V>;
     L645:  new <K, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
     L646:  prototype: WeakMap<any, any>;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 651 
            All declarations of 'prototype' must have identical modifiers. 

     L651:  interface WeakSet<T> {
     L652:      add(value: T): WeakSet<T>;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 666 
            All declarations of 'prototype' must have identical modifiers. 

     L665:  // #############################################################################################
     L666:  // ECMAScript 6: Iterators
     L667:  // Modules: es6.string.iterator, es6.array.iterator, es6.map, es6.set, web.dom.iterable

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 680 
            All declarations of 'prototype' must have identical modifiers. 

     L681:  interface Iterable<T> {

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 692 
            All declarations of 'value' must have identical modifiers. 

     L691:      [Symbol.iterator](): IterableIterator<string>;

[21:13:05]  typescript: node_modules/@types/core-js/index.d.ts, line: 804 
            All declarations of 'prototype' must have identical modifiers. 

     L803:  all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
     L804:  all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | 
     L805:  all<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 24 
            All declarations of 'size' must have identical modifiers. 

      L25:  interface WeakMapConstructor {

[21:13:05]  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;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 44 
            All declarations of 'prototype' must have identical modifiers. 

      L43:      new <T>(values?: T[]): Set<T>;
      L44:      readonly prototype: Set<any>;

[21:13:05]  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>;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 60 
            All declarations of 'prototype' must have identical modifiers. 

      L59:  declare var WeakSet: WeakSetConstructor;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.collection.d.ts, line: 73 
            All declarations of 'prototype' must have identical modifiers. 

[21:13:05]  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
      L17:  * otherwise.
      L18:  * @param predicate find calls predicate once for each element of the array, in ascending

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 95 
            All declarations of 'name' must have identical modifiers. 

      L94:      imul(x: number, y: number): number;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 216 
            All declarations of 'EPSILON' must have identical modifiers. 

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

[21:13:05]  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.

[21:13:05]  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;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.core.d.ts, line: 403 
            All declarations of 'flags' must have identical modifiers. 

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

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.iterable.d.ts, line: 24 
            All declarations of 'iterator' must have identical modifiers. 

      L24:  interface IterableIterator<T> extends Iterator<T> {
      L25:      [Symbol.iterator](): IterableIterator<T>;

[21:13:05]  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>;

[21:13:05]  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.

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.d.ts, line: 29 
            All declarations of 'prototype' must have identical modifiers. 

      L29:    * Returns a key from the global symbol registry matching the given Symbol if found. 
      L30:    * Otherwise, returns a undefined.

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 24 
            All declarations of 'hasInstance' must have identical modifiers. 

      L24:      readonly replace: symbol;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 30 
            All declarations of 'isConcatSpreadable' must have identical modifiers. 

      L30:      readonly search: symbol;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 36 
            All declarations of 'match' must have identical modifiers. 

      L36:      readonly species: symbol;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 42 
            All declarations of 'replace' must have identical modifiers. 

      L42:      readonly split: symbol;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 48 
            All declarations of 'search' must have identical modifiers. 

      L48:      readonly toPrimitive: symbol;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 54 
            All declarations of 'species' must have identical modifiers. 

      L54:      readonly toStringTag: symbol;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 60 
            All declarations of 'split' must have identical modifiers. 

      L60:      readonly unscopables: symbol;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 66 
            All declarations of 'toPrimitive' must have identical modifiers. 

      L67:  interface Array<T> {

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 72 
            All declarations of 'toStringTag' must have identical modifiers. 

      L72:  [Symbol.unscopables](): {
      L73:      copyWithin: boolean;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 78 
            All declarations of 'unscopables' must have identical modifiers. 

      L77:  findIndex: boolean;
      L78:  keys: boolean;
      L79:  values: boolean;

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 82 
            All declarations of '[Symbol.toStringTag]' must have identical modifiers. 

      L83:  interface Date {

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 142 
            All declarations of '[Symbol.toStringTag]' must have identical modifiers. 

                rface Math {
     L143:      readonly [Symbol.toStringTag]: "Math";

[21:13:05]  typescript: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts, line: 161 
            All declarations of '[Symbol.toStringTag]' must have identical modifiers. 

     L160:      [Symbol.match](string: string): RegExpMatchArray | null;

[21:13:05]  transpile failed 
[21:13:05]  copy finished in 5.26 s 
[21:13:06]  watch ready in 5.37 s 

Expected behavior:

Expect it to compile without errors. There must be some setting somewhere that will allow this to work each time I upgrade. It usually takes a few hours to figure this out each upgrade, and the cause seems to be different each time.

Steps to reproduce:

Related code: package.json file:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build; ionic-app-scripts minify --cleancss",
    "serve": "ionic-app-scripts serve",
    "minify": "ionic-app-scripts minify --cleancss",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build"
  },
  "config": {
    "cleancss": "./node_modules/@ionic/app-scripts/config/cleancss.config.js"
  },
  "dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/storage": "1.1.7",
    "ionic-angular": "2.0.0-rc.5",
    "ionic-native": "2.2.11",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.26",
    "sw-toolbox": "3.4.0",
    "jspdf": "^1.3.2",
    "ng2-chartjs2": "^1.2.0",
    "ng2-tour": "git+https://github.com/queejie/ng2-tour.git"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.0.0",
    "@types/lodash": "4.14.43",
    "typescript": "2.0.9"
  },
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],
  "description": "nocti: An Ionic project"
}

tsconfig.json

{
  "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
  }
}

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Your system information:

Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-rc.5
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0 
ios-sim version: 5.0.9 
OS: macOS Sierra
Node Version: v7.2.1
Xcode version: Xcode 8.2.1 Build version 8C1002

Copied from original issue: driftyco/ionic#10026

brandyscarney commented 7 years ago

From @queejie on January 14, 2017 2:56

If I run this command, I can get the build to work, but that does not seem right:

rm -rf node_modules/@types/core-js

brandyscarney commented 7 years ago

From @wbhob on January 16, 2017 5:30

I don't use CoreJS and it's fine for me, so you don't need the dependency in the first place. Just get rid of it.

brandyscarney commented 7 years ago

From @queejie on January 16, 2017 17:33

@wbhob I'm not sure what getting rid of it means. I looked through all the .json config files and found no reference to it.

rapropos commented 7 years ago

Judging from this, it's caused by that "ng-tour" package, so I would file a bug against it.

danbucholtz commented 7 years ago

@rapropos is correct. There isn't anything we can do about this as the typings issues comes from someone else's library.

Thanks, Dan