I think there is a specification error in the code
Uncaught Error: process.binding is not supported
at Object.process.binding (suman.js:293)
at Object.<anonymous> (suman.js:51174)
at Object.module.exports.100 (suman.js:51178)
at __webpack_require__ (suman.js:20)
at Object.<anonymous> (suman.js:3417)
at __webpack_require__ (suman.js:20)
at Object.<anonymous> (suman.js:38562)
at Object.<anonymous> (suman.js:39238)
at __webpack_require__ (suman.js:20)
at Object.<anonymous> (suman.js:80743)
It would be much better if process.binding() and process.chdir() were no-ops.
Throwing an error literally just breaks things, there is no point in polyfilling functions and just throwing an error, it doesn't make any sense. If the behavior is not supported in the browser just make it a noop. I hope this makes sense to you!
As you can see, in your existing code process.cwd() is pretty much a no-op even though it's not supported in the browser really either.
process.binding = function (name) {
throw new Error('process.binding is not supported'); //does nobody any favors
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported'); // does nobody any favors
};
I think there is a specification error in the code
It would be much better if
process.binding()andprocess.chdir()were no-ops.Throwing an error literally just breaks things, there is no point in polyfilling functions and just throwing an error, it doesn't make any sense. If the behavior is not supported in the browser just make it a noop. I hope this makes sense to you!
As you can see, in your existing code
process.cwd()is pretty much a no-op even though it's not supported in the browser really either.