manfredsteyer / angular2-pwa-serviceworker-basta2016

10 stars 7 forks source link

Error in run webpack #2

Open final87 opened 7 years ago

final87 commented 7 years ago

Hello, "npm install" succeds but running "npm run webpack" gives this error:

Version: webpack 1.14.0
Child
    Hash: f62bbc99a0af5c373e75
    Version: webpack 1.14.0
    Time: 10632ms
            Asset     Size  Chunks             Chunk Names
        sw.js.map     2 kB          [emitted]
           app.js   450 kB       0  [emitted]  app
        vendor.js  2.56 MB       1  [emitted]  vendor
       app.js.map   523 kB       0  [emitted]  app
    vendor.js.map  2.98 MB       1  [emitted]  vendor
            sw.js  1.98 kB          [emitted]
       [0] multi vendor 40 bytes {1} [built]
        + 381 hidden modules

    ERROR in [default] C:/angular2-pwa-serviceworker-basta2016-master/declarations.d.ts:2:12
    Subsequent variable declarations must have the same type.  Variable 'caches' must be of type 'CacheStorage', but here has type 'any'.

    ERROR in [default] C:/angular2-pwa-serviceworker-basta2016-master/declarations.d.ts:4:12
    Subsequent variable declarations must have the same type.  Variable 'Headers' must be of type '{ new (init?: any): Headers; prototype: Headers; }', but here has type 'any'.

    ERROR in [default] C:/angular2-pwa-serviceworker-basta2016-master/declarations.d.ts:5:12
    Duplicate identifier 'fetch'.

    ERROR in [default] C:/angular2-pwa-serviceworker-basta2016-master/node_modules/typescript/lib/lib.d.ts:19116:17
    Duplicate identifier 'fetch'.
    Child serviceworker-plugin:
            Asset  Size  Chunks             Chunk Names
        sw.js.map  2 kB       0  [emitted]
           [0] ./sw-boot.js 353 bytes {0} [built]
Child
    Hash: 03d6c651a165f585d70a
    Version: webpack 1.14.0
    Time: 12341ms
        Asset     Size  Chunks             Chunk Names
        sw.js   964 kB       0  [emitted]  sw
    sw.js.map  1.14 MB       0  [emitted]  sw
        + 154 hidden modules

    ERROR in [default] C:/angular2-pwa-serviceworker-basta2016-master/declarations.d.ts:2:12
    Subsequent variable declarations must have the same type.  Variable 'caches' must be of type 'CacheStorage', but here has type 'any'.

    ERROR in [default] C:/angular2-pwa-serviceworker-basta2016-master/declarations.d.ts:4:12
    Subsequent variable declarations must have the same type.  Variable 'Headers' must be of type '{ new (init?: any): Headers; prototype: Headers; }', but here has type 'any'.

    ERROR in [default] C:/angular2-pwa-serviceworker-basta2016-master/declarations.d.ts:5:12
    Duplicate identifier 'fetch'.

    ERROR in [default] C:s/angular2-pwa-serviceworker-basta2016-master/node_modules/typescript/lib/lib.d.ts:19116:17
    Duplicate identifier 'fetch'

npm version 3.10.5 node version 6.2.2

happyahluwalia commented 7 years ago

Make the following change in the declarations.d.ts file and try again declare var toolbox: any; declare var caches: CacheStorage; declare var System: any; declare var Headers: { new (init?: any): Headers; prototype: Headers; }; //declare var fetch: any;