Issue with access to global process variable when using Webpack
foxik0169 opened this issue · 1 comments
Hello,
I've stumbled upon an issue with when using Node engine with server-side bundle generated by Webpack 4. In the javascript generation process in the Renderer class, there's following line added to the file:
var process = process || { env: {} };
In my case, the process
global resolves to undefined, which causes my script to malfunction - axios won't recognize Node environment. Axios can be thus used to reproduce this issue as it uses this condition to determine Node env typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]'
.
To fix this, I've replaced the global with require('process')
which solved the issue for my instance.
I wanted to ask if this is by design and/or this is some issue with the webpack bundle or it is, indeed, a bug.
Node versions: 12.4.0 / 6.16.0 - both same result
Webpack version: 4.34.0 - target set to 'node', transpilation via babel
Thanks for feedback.
Daniel
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.