react-lightgallery icon indicating copy to clipboard operation
react-lightgallery copied to clipboard

"Process is not defined" after webpack was upgraded from version 4 to 5

Open miedzikd opened this issue 4 years ago • 1 comments

Hi :) At start I want to say thank you for your great work!

Today I tried to upgrade webpack to v5 ... Unfortunately, I get this error. Can anyone suggest how to solve it?

Uncaught ReferenceError: process is not defined
    at Object../node_modules/uniqid/index.js (index.js:14)
    at __webpack_require__ (bootstrap:18)
    at Object../node_modules/react-lightgallery/dist/index.js (index.js:1)
    at __webpack_require__ (bootstrap:18)
    at Module../assets/react/simple-website/Components/Templates/Basic/Basic.tsx (index.ts:18)
    at __webpack_require__ (bootstrap:18)
    at Module../assets/react/simple-website/SimpleWebsite.tsx (assets_react_simple-website_SimpleWebsite_tsx.js:3761)
    at Function.__webpack_require__ (bootstrap:18)

image

miedzikd avatar Feb 16 '21 14:02 miedzikd

I have this problem too and tracked it down to this:

https://github.com/browserify/commonjs-assert/issues/55 This is caused by webpack 5 being broken, and not polyfilling node globals by default. You’ll have to fix it by adding stuff to your config

davidnewcomb avatar Mar 10 '22 00:03 davidnewcomb