Skip to content
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

Looking for browser object #314

Closed
westlakem opened this issue May 15, 2019 · 4 comments
Closed

Looking for browser object #314

westlakem opened this issue May 15, 2019 · 4 comments

Comments

@westlakem
Copy link

I'm trying to use this in a nativescript project, and on startup I'm getting the following error: Cannot read property 'browser' of undefined

@broofa
Copy link
Member

broofa commented Aug 19, 2019

The only place this project references browser is in the test scripts. Issue is not in this module.

@broofa broofa closed this as completed Aug 19, 2019
@jbouloux1
Copy link

jbouloux1 commented Dec 2, 2020

I'm getting the same issue with this module.

`TypeError: Cannot read property 'browser' of undefined
JS:     at Object.../node_modules/pbkdf2/lib/default-encoding.js (file: node_modules/pbkdf2/lib/default-encoding.js:3:11)
JS:     at __webpack_require__ (file: src/webpack/bootstrap:816:0)
JS:     at fn (file: src/webpack/bootstrap:120:0)
JS:     at Object.../node_modules/pbkdf2/index.js (file: node_modules/pbkdf2/index.js:4:22)
JS:     at __webpack_require__ (file: src/webpack/bootstrap:816:0)
JS:     at fn (file: src/webpack/bootstrap:120:0)
JS:     at Object.../node_modules/crypto-browserify/index.js (file: node_modules/crypto-browserify/index.js:14:8)
JS:     at __webpack_require__ (file: src/webpack/bootstrap:816:0)
JS:     at fn (file:///data/data/org.nativescript.D3...`

@broofa
Copy link
Member

broofa commented Dec 3, 2020

@jbouloux1

  1. Edited your comment to format stacktrace so it's readable
  2. Stack trace does not mention uuid anywhere. I.e. this ain't our problem.

In the future, please take a bit more time to verify that the first hit Google returns when you search for an error message is actually relevant before commenting.

@ctavan
Copy link
Member

ctavan commented Dec 3, 2020

@jbouloux1 while I 💯% agree with what @broofa said…

This looks like a problem with your webpack resolve.mainFields config: Apparently you are bundling for the browser but webpack seems to be using the Node.js variant of this library which causes it to pull in a Node.js crypto polyfill. Please check your webpack config.

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

4 participants