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

pid is NaN when used with browserify #4

Closed
rahatarmanahmed opened this issue Nov 30, 2015 · 4 comments
Closed

pid is NaN when used with browserify #4

rahatarmanahmed opened this issue Nov 30, 2015 · 4 comments

Comments

@rahatarmanahmed
Copy link
Contributor

I'm using this module with browserify and ObjectId.generate() is returning strings like 565c8e5032d34b0NaNa0ad07. Found that this is because when this line executes on the browser, process exists but process.pid does not.

A workaround is to use new ObjectId().toString(), which generates a correct id.

@williamkapke
Copy link
Collaborator

How strange. Since ObjectId().toString() uses generate() I would thing you would still see the issue.

Anyhow, it's easy enough to check and make sure that porcess.pid is there :)

Thanks for the PR!

@rahatarmanahmed
Copy link
Contributor Author

No problem! Yeah, I'm not sure why only generate() was broken, I didn't look too far into it.

If it's not too much trouble, could you publish this fix to npm in a new version?

@williamkapke
Copy link
Collaborator

1.1.2 published 👍

@rahatarmanahmed
Copy link
Contributor Author

Thanks!

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