-
Notifications
You must be signed in to change notification settings - Fork 61
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.execArgv is undefined #75
Comments
I will submit a PR for these |
shouldn't your code be checking to see if it's running in a browser (e.g. with a check on Even if it returned an empty array, there would still be a pretty good chance of an error considering in node the array will always have at least 1 thing in it. |
idk what to say, the purpose of polyfilling these core modules for the browser is to simply have the most reasonable possible values. If you look at this project's code, eliminating these if/else checks is one of the primary purposes of these types of polyfills. |
yes but the caveat being that it applies to code that can reasonably run in the browser or node, the only reason you'd check I would suspect you are getting this error because you are including modules in a webpack build you did not intend to include. |
@calvinmetcalf fully intend to include the modules that I did you have
it's not a big deal, I will take the code and repurpose it, most people are not taking the kind of backend codebase that I have and trying to browserify it. The reason you haven't seen this issue before, is because nobody has tried to browserify |
this library is included in a lot of bundles by default so we have a policy of being fairly conservative on what we include. I'm not against adding it in principle, I do suspect there is a high probability that the call to exacArgv makes some assumptions about the length of the array and what's in certain positions, so it might not be as useful as you'd like :) |
I won't be using I could do this in my code:
but it really helps if this call is loaded before my code. I think you would understand why it's important for this to be defined before any user code is invoked, that's why things like this should be implemented by the polyfill, not by my if/else checks. and of course the if/else checks are burdensome for devs too. |
looking for process.execArgv
in this codebase, it should just be an empty array
process.execArgv = []
I call this in my code:
var execArgs = process.execArgv.slice(0);
and it will obviously error out because apparently process.execArgv is not defined.
please and thank you
The text was updated successfully, but these errors were encountered: