-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Module not found: Error: Can't resolve 'crypto' in 'C: #494
Comments
I have tried it to install crypto but again is not working, all versions from 10.0 and above is not working on angular projects I am not sure if they don't work on any typescript version |
Can you please provide us a link to the source that we can fork/download? This will help with investigation. |
@nkreeger I have created a repo you can run inside the root folder : you can clone the ptoject https://github.com/George35mk/example-tf-error.git |
@nkreeger thank you for looking on this |
The same happens with stackblitz.com @nkreeger |
What I have found so far is that: And I think the tensorflow.js is not working on any newest angular application. |
Hi @George35mk - I found a couple of cycles to try this out. It looks like this is a problem with the core-parts of the angular webpack bundler. I followed the steps here: https://gist.github.com/niespodd/1fa82da6f8c901d1c33d2fcbb762947d But instead of using a pre-install, I just hand edited `node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js' and changed the lines in that regex: // old:
node: false,
// new:
node: { crypto: true, stream: true }, I found an issue that you should chime-in on to help fix this down the road: angular/angular-cli#10954 Hope this helps! |
@nkreeger Thank you very much. I am surprised how you find the solution. |
not fixed Yet! |
This issue is related to another one that is 2 years old ... guys common ... |
@George35mk please let us know if this is still an issue ? |
I love you |
Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks! |
While the original issue was an error, it is now manifested as a warning on my system.
My Angular app works as expected in the browser. Environment
|
thank you. It helped me!!!! |
Because I needed to work with some 3D tensors I installed again the tensorflow.js package in my angular application, and again I get the same error:
what I found to solve this warnings without modifing any of the angular core files but only your package.json try this on your package.json {
"scripts": { },
"dependencies": { },
"devDependencies": { },
"browser": {
"crypto": false
}
}
|
Worked for me! Thank you! |
I love you. You save my time. |
感謝您 這很有幫助 |
Thank you providing such a wonderful solution |
I cannot find the file. |
In angular 11, the path of the file changed. So the new file looks like this:
|
same issue 2021 |
Same issue 2022 |
I'm using React, and downgrading "react-scripts" version in package.json from "5.0.0" to "4.0.3" did the trick for me. |
To get help from the community, check out our Google group.
TensorFlow.js version
"@tensorflow/tfjs": "^0.12.0",
Browser version
Version 67.0.3396.99 (Official Build) (64-bit)
Describe the problem or feature request
I am using angular 6 with tensorflow.js in the latest versions of tensorflow I get a warning in the console that somme crypto module is not found I have this warning all the time, what should I do/?
Code to reproduce the bug / link to feature request
import * as tf from '@tensorflow/tfjs';
this is from chrome console
and this is what I see in the console
The text was updated successfully, but these errors were encountered: