VLZH/react-lightgallery

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

Opened this issue · 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

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

browserify/commonjs-assert#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