Closed chaoranxie closed 5 years ago
oddly enough i can run ./node_modules/ng-pwa-tools/bin/ngu-sw-manifest.js --out dist/ngsw-manifest.json
without error, so i am not sure if i am doing something wrong
./node_modules/ng-pwa-tools/bin/ngu-sw-manifest.js --module src/app/app.module.ts --out dist/ngsw-manifest.json
will give you following error, i had the same issue with my own project and filed an issue here https://github.com/alxhub/io17/issues/2 with ng-pwa-tools
/Users/chaoranxie/dev/pwa-workshop-angular/node_modules/hammerjs/hammer.js:2643
})(window, document, 'Hammer');
^
ReferenceError: window is not defined
at Object.<anonymous> (/Users/chaoranxie/dev/pwa-workshop-angular/node_modules/hammerjs/hammer.js:2643:4)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/chaoranxie/dev/pwa-workshop-angular/src/app/app.module.ts:9:1)
at Module._compile (module.js:570:32)
I am also same error with this command: ./node_modules/.bin/ngu-sw-manifest --module src/app/app.module.ts \ --out dist/ngsw-manifest.json
I assume that this might be to do something with node.js. There might be node server behind that command and node does not have windows (like in your situation) or localStorage (like in my). But when I did remove myt localStorage reference in my app.module.ts then I get this kind of message: "Error: C:\folder\folder1\src\app\app.module.ts contains no @NgModules"
There is a new version of Angular PWA workshop released:
This repo will no longer be maintained.
Tried to follow http://slides.com/webmax/pwa-graz#/24 but getting errors
Not sure if package.json needs to be updated.
ngu-sw-manifest --out dist/ngsw-manifest.json