Skip to content

Module not found warnings: crypto, fs and timers #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mburakkalkan opened this issue Aug 9, 2018 · 1 comment
Closed

Module not found warnings: crypto, fs and timers #227

mburakkalkan opened this issue Aug 9, 2018 · 1 comment

Comments

@mburakkalkan
Copy link

When start by npm run ng:serve:web these warnings shown up in terminal:

WARNING in ./node_modules/zone.js/dist/zone-mix.js
Module not found: Error: Can't resolve 'crypto' in 'd:\Projeler\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 'd:\Projeler\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 'd:\Projeler\angular-electron\node_modules\zone.js\dist'

and Uncaught ReferenceError: process is not defined error in the browser.

To solve:

In the node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\webpack-config\browser.js change node: false to node: {crypto: true, fs: 'empty'}

@mburakkalkan mburakkalkan changed the title Module not found errors: crypto, fs and timers Module not found warnings: crypto, fs and timers Aug 9, 2018
@maximegris
Copy link
Owner

Hi

The problem should not persist with the last version.
Some hooks were added on node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js file to manage both electron and web mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants