react-contexify
react-contexify copied to clipboard
Uncaught ReferenceError: process is not defined
The error happened when Webpack version 5 was used due to the fact that Webpack 5 removed the ability to access environment variables using the notation process.env.MY_ENV_VAR
My temporary solution:
npm install -D process
and add the following config in Webpack config file:
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
same error when using vite
same error when using vite
Hey, I encountered this same error and was able to fix it with this. Not sure what else it might break though.
When use vite
Add the following config in vite config file:
export default defineConfig({
define: {
'process.env': {}
}
})
Happening with esbuild. Adding this esbuild config doesn't help:
define: {
'process.env': {}
}
The use of process will be removed.