question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't resolve 'crypto' (Angular 6)

See original GitHub issue

General information

  • SDK version: 3.33.0
  • Environment: Sandbox and Production (Angular)
  • Browser and OS: All

Issue description

When trying to build an angular 6 application that uses braintree-web it will print out the following warning.

WARNING in ./node_modules/braintree-web/data-collector/vendor/sjcl.js
Module not found: Error: Can't resolve 'crypto' in '/REDACTED/node_modules/braintree-web/data-collector/vendor'

Angular 6 removed the shims to support non browser (node) libraries. What can be done in this case?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
crookedneighborcommented, Aug 9, 2018

v3.36.0 on npm includes a browser property in the package.json that points to a browserified version of the file. Webpack should use this path instead and this should fix the issues with Angular 6. Please update and comment here if you’re still having issues.

2reactions
crookedneighborcommented, Aug 3, 2018

I think I’ve found a solution for this. Will keep y’all updated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Can't resolve 'crypto' - Stack Overflow
I ran into a similar issue lately while trying to use another library (tiff.js) in a small project I was experimenting with.
Read more >
Angular error during compilation - Can't resolve 'crypto' #17
Hello, I am running Angular and requiring 'snarkjs' library. ... The problem comes from line 35 of that file (zqfield.js). It tries to...
Read more >
Module not found: Error: Can't resolve 'crypto' [Solved]
To solve the "Module not found: Error: Can't resolve 'crypto'" error, set the browser.crypto property to false in your package.json file or include...
Read more >
JavaScript : Module not found: Error: Can't resolve 'crypto'
JavaScript : Module not found: Error: Can't resolve ' crypto ' [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript ...
Read more >
Can't resolve 'crypto' in node_modules/bson/dist react
I'm using realm-web on my react app to build a simple task reminder app. But, when I start/build the app it is giving...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found