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

TypeError: process.pid is undefined #77

Closed
serhiipalash opened this issue Mar 1, 2017 · 5 comments
Closed

TypeError: process.pid is undefined #77

serhiipalash opened this issue Mar 1, 2017 · 5 comments

Comments

@serhiipalash
Copy link

Didn't update any package or system environment, but today when I call cuid() I get

TypeError: process.pid is undefined
nodePrint
[path to my react component]
cuid
webpack:///./~/cuid/dist/node-cuid.js?:49:23

Using
cuid: 1.3.8
webpack: 2.2.0
webpack-dev-server: 2.2.0
node v6.9.4
npm v3.10.10
yarn 0.20.3

Tried on cuid@1.2.0, got the same result.

@ericelliott
Copy link
Collaborator

You can see that webpack is trying to use node-cuid.js instead of the browser build. I assume you're seeing this error in the browser?

@serhiipalash
Copy link
Author

Yes, I am seeing this error in the browser.

@ericelliott
Copy link
Collaborator

Tell Webpack to use the browser build (see the "browser" key in package.json). I'm not sure why it's not respecting the "browser" key -- do you have a highly customized browser build?

@serhiipalash
Copy link
Author

serhiipalash commented Mar 4, 2017

Hm, it worked when I added this to my package.json

"browser": {
    "cuid": "./node_modules/cuid/dist/browser-cuid.js"
}

Not sure why it was broken. I have target: 'web' in my webpack.config.js

@ericelliott
Copy link
Collaborator

Can you create a PR?

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