-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-error-overlay@6.0.10 Error when hot update #12064
Comments
I have seen this also, I have had to add a yarn module resolution to pin react-error-overlay to 6.0.9 seen here also https://stackoverflow.com/questions/70357360/process-is-not-defined-on-hot-reload/70402397 i'm currently on cra v4.0.3 |
Wish react devs would realize their tools are used outside React projects (bundled with webpack-dev-server in my case) and I'm not running in an environment where process is defined. Why not just create helper functions to deal with process? Ex: "win32" === getProcessValue("platform")
"production" === getProcessEnvValue("NODE_ENV")
export function getProcessValue(key) {
if (typeof process === "undefined") {
return undefined;
}
return process[key];
}
export function getProcessEnvValue(key) {
const env = getProcessValue("env");
if (!env) {
return undefined;
}
return env[key];
} Please and thank you! |
@gamedevsam Can you elaborate on what you mean by "tools are used outside React projects (bundled with webpack-dev-server in my case)"? |
I'm using a stack that consists of LWC components created with create-lwc-app. I don't use React anywhere there, but Webpack's HMR seems to bundle some react libs to provide debugging utilitites to non-react projects. |
Uncaught ReferenceError: process is not defined
at Object.4043 (:2:13168)
at r (:2:306599)
at Object.8048 (:2:9496)
at r (:2:306599)
at Object.8641 (:2:1379)
at r (:2:306599)
at :2:315627
at :2:324225
at :2:324229
at HTMLIFrameElement.e.onload (index.js:1:1)
1.npm install
2.npm run start
3.change some code
The text was updated successfully, but these errors were encountered: