Closed AuglyXu closed 1 year ago
It seems you may forget to define some process.env.xxx
which cause you access process on the browser(which not exits), you can check out the error stack and see how do you use process
in your code
@AuglyXu is your problem solved
I will check tomorrow.Today I took a rough look at my project, but I didn’t find undefined process.env.xxx.If the error still exist,I will try to reproduce in demo project
i have this problem too.
"@rspack/cli": "^0.1.9",
"@rspack/plugin-node-polyfill": "^0.1.9",
please provide reproducible demo so we can find out the reason
@hardfist demo is here https://github.com/yxzh614/demo_rspack_error
problem is these deps
"@rspack/plugin-node-polyfill": "^0.1.9",
"jmuxer": "^2.0.5",
@yxzh614 you forget to config define, so process.env.NODE_DEBUG is not transformed
builtins: {
define: {
'process.env.NODE_DEBUG': JSON.stringify(false),
},
html: [
{
template: './index.html',
},
],
},
@hardfist demo is here https://github.com/AuglyXu/lerna-test problem is the deps "insight-iclient-leaflet"
how can i cover all the process.env.xxx in 3rd party library
@hardfist demo is here AuglyXu/lerna-test problem is the deps "insight-iclient-leaflet"
how can i cover all the process.env.xxx in 3rd party library
if you find third party ship process.env.xxx, it's normally a bug of the library or the library should document this behavior, bundler can't automatic fix this for you
@hardfist demo is here AuglyXu/lerna-test problem is the deps "insight-iclient-leaflet" how can i cover all the process.env.xxx in 3rd party library
if you find third party ship process.env.xxx, it's normally a bug of the library or the library should document this behavior, bundler can't automatic fix this for you
The dep is forked from @supermap/iclient-leaflet. It is a frequently used library and I can start successfully on webpack.Please can you help me locate what caused the problem in demo and how can i fixed the error?Thanks.
I define the environment and use the demo from @yxzh614 , it occurs another unexpected error and my demo occured too.These errors depend on the third-party library used and are not predictable.
I define the environment and use the demo from @yxzh614 , it occurs another unexpected error and my demo occured too.These errors depend on the third-party library used and are not predictable.
your demo is not a minimal demo and it seems your application use libraries which use node api, so you need to provide node-polyfill to make it work, after upgrade your @rspack/cli to 0.1.10 and provide node-polyfill by @rspack/plugin-node-polyfill@0.1.9-alpha0, your application is running
I define the environment and use the demo from @yxzh614 , it occurs another unexpected error and my demo occured too.These errors depend on the third-party library used and are not predictable.
your demo is not a minimal demo and it seems your application use libraries which use node api, so you need to provide node-polyfill to make it work, after upgrade your @rspack/cli to 0.1.10 and provide node-polyfill by @rspack/plugin-node-polyfill@0.1.9-alpha0, your application is running
Thanks, and the error had fixed
If you are using rsbuild then install https://v0.rsbuild.dev/plugins/list/plugin-node-polyfill It solve problem for me
System Info
System:mac
Details
启动项目后发生的问题,不知道问题具体出现在哪里
Reproduce link
No response
Reproduce Steps
yarn install yarn start