[Web] Uncaught ReferenceError: process is not defined with blank white screen
See original GitHub issueSummary
Initializing fresh project with expo init, running expo start:web, and then changing App.tsx file to produce an error. For example:
export default function App() {
return (
<View style={styles.container}>
<Text>{hello.world()}</Text>
<StatusBar style="auto" />
</View>
);
}
will show a blank white screen instead of an overlay of error from “react-error-overlay”. As well as in console the following error:
Uncaught ReferenceError: process is not defined
4043 blank line 4342 > injectedScript:2
r blank line 4342 > injectedScript:2
8048 blank line 4342 > injectedScript:2
r blank line 4342 > injectedScript:2
8641 blank line 4342 > injectedScript:2
r blank line 4342 > injectedScript:2
<anonymous> blank line 4342 > injectedScript:2
<anonymous> blank line 4342 > injectedScript:2
<anonymous> blank line 4342 > injectedScript:2
onload index.js:1
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Web
SDK Version (managed workflow only)
45
Environment
expo-env-info 1.0.3 environment info:
System:
OS: Windows 10 10.0.19044
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-212.5712.43.2112.8512546
npmPackages:
expo: ~45.0.0 => 45.0.4
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-web: 0.17.7 => 0.17.7
Expo Workflow: managed
Reproducible demo
To Reproduce:
- initialize new expo project: expo init project
- in command line> expo start:web
- change in app.tsx to create error. ex:
<Text>{hello.world()}<Text>
where hello is not defined - in browser, the screen should be blank with error in console about process is not defined
Github repo: https://github.com/ramiel1999/expo-web-blank-screen
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:15
Top Results From Across the Web
React Uncaught ReferenceError: process is not defined
The problem is because you lose window.process variable when React hotloads, and process exists only on node, not the browser. So you should ......
Read more >React ReferenceError: process is not defined | bobbyhadz
To solve the "Uncaught ReferenceError: process is not defined" in React, open your terminal in your project's root directory and update the version...
Read more >ReferenceError: “process is not defined” - GIMTEC
In NodeJS, “process” is defined, but not in the browser. This is because NodeJS and the browser are different runtime environments. Common Error....
Read more >Comparing the New Generation of Build Tools - CSS-Tricks
... in the browser, I was met with the “white screen of death” and an “Uncaught ReferenceError: process is not defined” console error....
Read more >9 Proven Methods to Fix the WordPress White Screen of Death
This error makes your website inaccessible to both administrators and visitors. The WSoD can also be incredibly frustrating, due to the lack of ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have spent some more time in this and finally got a fix for myself and more information on why it was happening.
tl;dr
Force
react-error-overlay
to version6.0.9
and the process not defined error will go away and the error screen will show again.Why
Create React App owns the
react-error-overlay
and has recently updated all thereact-scripts
to support webpack 5. During this transition they pushed out an update toreact-error-overlay
to support webpack 5. Since it was only a patch version update most people have pulled the update into their code, but unfortunately it is not backwards compatible with Webpack 4!Expo support for webpack 5 is still in progress
Issue with react-error-overlay and process not defined
Why was this closed?