maximegris / angular-electron

Ultra-fast bootstrapping with Angular and Electron :speedboat:
https://www.maximegris.fr/angular-electron/
MIT License
5.67k stars 1.37k forks source link

Updating to Angular7 breaks when running ng:serve:web #267

Closed emcee22 closed 6 years ago

AleksMeshkov commented 6 years ago

As for me I've got it running with no problem.

image

I see only see some warnings in the console:

WARNING in ./node_modules/zone.js/dist/zone-mix.js
Module not found: Error: Can't resolve 'crypto' in '/Users/alekseymeshkov/Devel/angular-electron/node_modules/zone.js/dist'

WARNING in ./node_modules/zone.js/dist/zone-mix.js
Module not found: Error: Can't resolve 'fs' in '/Users/alekseymeshkov/Devel/angular-electron/node_modules/zone.js/dist'

WARNING in ./node_modules/zone.js/dist/zone-mix.js
Module not found: Error: Can't resolve 'timers' in '/Users/alekseymeshkov/Devel/angular-electron/node_modules/zone.js/dist'

I think I have this warnings because of using nodeJs 10

DBnR1 commented 6 years ago

@AleksMeshkov I get the same Warnings as Errors and the build fails. Using Angular 6.1 and Node 8.11.

Clearing the code of all references to Electron and Node resolves this though. Just need better conditional importing I guess so that stuff isn't included if using ng:serve:web

maximegris commented 6 years ago

Replace content at the end of of polyfill.ts


[...] 
/***************************************************************************************************
 * Zone JS is required by default for Angular itself.
 */
import 'zone.js/dist/zone';  // Included with Angular CLI.

/***************************************************************************************************
 * APPLICATION IMPORTS
 */

It should remove errors. I'm working on a new version of this project with Electron 3 + Angular 7