Packager error: "Can't find variable: process"
See original GitHub issueDo you want to request a feature or report a bug? Bug
Behavior The issue was initially discovered in #65 after people began using the latest metro-bundler 0.20.0 version to work around dynamic requires in packages like moment.js
Packager throws the following error when bundling:
Unhandled JS Exception: Can't find variable: process
Repro Steps
- Add metro-bundler 0.20.0 to package.json as a “resolutions” entry for react-native:
"resolutions": {
"react-native/metro-bundler": "0.20.0"
}
- Run
react-native run-ios
as normal.
NOTE: The fact that this issue manifested for people in metro-bundler@0.20.0 is a red herring. This issue appears to be happening with older versions of metro-bundler as well. I’ve confirmed the same error appears in metro-bundler@0.19.0. I haven’t tried to reproduce it in any versions older than 0.19.0 yet.
Environment Node: v8.5.0
package.json
"dependencies": {
"react": "16.0.0-beta.5",
"react-native": "0.49.3"
},
"resolutions": {
"react-native/metro-bundler": "0.19.0"
},
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:35 (8 by maintainers)
Top Results From Across the Web
Reference Error: Can't find variable process (http 10.0.2.2:8081)
I'm having trouble building my react-native project. When I try to build it - I get this error: referenceerror can't find variable process...
Read more >Cannot find name 'process' Error in TypeScript | bobbyhadz
To solve the error "Cannot find name process", install the node types by running npm i -D @types/node . If the error is...
Read more >react-native-config - npm
Module to expose config variables to your javascript code in React Native, supporting iOS, Android and Windows.
Read more >Tutorial: Create a Node.js and React app in Visual Studio
To see and set project properties and environment variables, press Alt+Enter, or right-click the project and select Properties from the context ...
Read more >find_package — CMake 3.25.1 Documentation
The Find<PackageName>.cmake file is not typically provided by the package itself. ... stops processing with an error message if the package cannot be...
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 FreeTop 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
Top GitHub Comments
@richardgirges Any updates on this ?
@PvanHengel updating to RN
0.50.3
fixed this for me… hopefully fixes for you too.