Description
To browserify Nit, we need to change a dependency or tweak the module design.
Reference: https://stackoverflow.com/questions/62492311/browserify-is-not-working-gives-undefined-process-versions-node
Steps to Reproduce
-
Create a bundle
$ browserify -o nit.min.js src/*
-
Add the bundle in a HTML.
Expected Behavior
- Expected: Browser can include and execute the bundle successfully
- Actual: Bundle returns an error
Logs
Got the error in the browser console
Uncaught TypeError: Cannot read properties of undefined (reading 'split')
at Object.<anonymous> (nit.min.js:39869:57)
at Object.<anonymous> (nit.min.js:39992:4)
at Object.225._process (nit.min.js:39992:17)
at o (nit.min.js:1:265)
at nit.min.js:1:316
at Object.<anonymous> (nit.min.js:59362:22)
at Object.<anonymous> (nit.min.js:60850:4)
at Object.329.../as-promise/normalize-arguments (nit.min.js:60850:17)
at o (nit.min.js:1:265)
at nit.min.js:1:316
nit.min.js:39869:57
const nodejsMajorVersion = Number(process.versions.node.split('.')[0]);
Environment
- Nit: v1.2.4
Description
To browserify Nit, we need to change a dependency or tweak the module design.
Reference: https://stackoverflow.com/questions/62492311/browserify-is-not-working-gives-undefined-process-versions-node
Steps to Reproduce
Create a bundle
Add the bundle in a HTML.
Expected Behavior
Logs
Got the error in the browser console
nit.min.js:39869:57
Environment