question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Packager error: "Can't find variable: process"

See original GitHub issue

Do 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

  1. Add metro-bundler 0.20.0 to package.json as a “resolutions” entry for react-native:
"resolutions": {
  "react-native/metro-bundler": "0.20.0"
}
  1. 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:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:35 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
mackenziemancecommented, Oct 10, 2017

@richardgirges Any updates on this ?

7reactions
bnjmcommented, Nov 8, 2017

@PvanHengel updating to RN 0.50.3 fixed this for me… hopefully fixes for you too.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found