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

'process && process.pid' test doesn't work in strict mode #20

Open
hacker64 opened this issue Jul 26, 2018 · 2 comments
Open

'process && process.pid' test doesn't work in strict mode #20

hacker64 opened this issue Jul 26, 2018 · 2 comments

Comments

@hacker64
Copy link

I'd suggest changing the following:
var pid = process && process.pid ? process.pid.toString(36) : '' ;
to:
var pid = typeof process !== 'undefined' && process.pid ? process.pid.toString(36) : '' ;

The 2nd version is more portable and safer. I pulled the uniqid module into an Angular 6 project and the code ended up running in strict mode, which caused a ReferenceError on 'process'.

@dri-developer
Copy link

I too experienced this error with Angular 6

@lubkoKuzenko
Copy link

add this to polyfills.js

(window as any).process = {
  env: { DEBUG: undefined }
};

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

3 participants