ReferenceError: process is not defined using CRA and CoreUI

32 Views Asked by At

I have a NodeJS app I built using Create React App, which uses the CoreUI library. Ever since I updated CoreUI from version 3.4.2 to 4.x, the app crashes with this error:

process is not defined
ReferenceError: process is not defined
    at http://localhost:3000/static/js/vendors-node_modules_coreui_icons-react_dist_index_es_js-node_modules_coreui_react_dist_index_es_js.chunk.js:1283:5
    at renderWithHooks (http://localhost:3000/static/js/bundle.js:67429:22)
    at updateForwardRef (http://localhost:3000/static/js/bundle.js:69262:24)
    at beginWork (http://localhost:3000/static/js/bundle.js:71001:20)
    at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:58006:18)
    at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:58050:20)
    at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:58105:35)
    at beginWork$1 (http://localhost:3000/static/js/bundle.js:75096:11)
    at performUnitOfWork (http://localhost:3000/static/js/bundle.js:74107:16)
    at workLoopSync (http://localhost:3000/static/js/bundle.js:74052:9)

I tried the solutions here, but none have resolved the issue - including the addition of react-error-overlay 6.0.9 in my devDependencies. I've done a clean install as well.

I don't understand why I'm getting this error in the first place since I'm not calling 'process' anywhere; the only place in my code with 'process' is in the serviceWorker.js file, which I believe was built with CRA.

I'm running Node 20.10.0, React 17.0.2, react-scripts 5.0.1, @coreui-react 4.11.1.

Any assistance is appreciated. Thank you in advance!

0

There are 0 best solutions below