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.

RN 0.46 Packager fails to resolve Module XMLHttpRequest

See original GitHub issue

I just upgraded from 0.44 to 0.46 (via the Git-Upgrade tool) and whenever I start the packager, it runs but fails with output:

Loading dependency graph, done.
Bundling `index.android.js`  69.5% (1416/1698), failed.
error: bundling failed: "Unable to resolve module `XMLHttpRequest` from `C:\\Git\\[project name]\\node_modules\\react-native\\Libraries\\Core\\InitializeCore.js`: Module does not exist in the module map or in these directories:\n  C:\\Git\\[project name]\\node_modules\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`."

I tried everything inside this message, but no luck. This also happens with 0.47. Of course I also tried npm install xmlhttprequest

Environment

  1. react-native -v: react-native-cli: 2.0.1 react-native: 0.46.4
  2. node -v: v7.10.0
  3. npm -v: 5.3.0
  4. yarn --version:
  • Target Platform: android
  • Development Operating System: Windows 10 x64
  • Build tools:

Steps to Reproduce

maybe just do what the above says…

Expected Behavior

A working package

Actual Behavior

No working package and the above error message

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:14

github_iconTop GitHub Comments

1reaction
hongjie104commented, Sep 22, 2017

@stephenlaughton yarn add d3@4.10.0

0reactions
stale[bot]commented, Nov 21, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error "Unable to resolve module xmlhttprequest" while ...
By adding these lines on package.json fixes this problem, i have added those lines in my package.json but still getting the same error....
Read more >
Error Cannot find module xmlhttprequest | Edureka Community
I am getting the error: Cannot find module 'xmlhttprequest'. When I remove the first line, I am getting: XMLHttpRequest is not defined.
Read more >
can't resolve 'stream' in cipher-base - You.com | The AI Search ...
Error: Unable to resolve module stream from C:\**\node_modules\cipher-base\index.js: stream could not be found within the project.
Read more >
xmlhttprequest - npm
Usage. Here's how to include the module in your project and use as the browser-based XHR object. var XMLHttpRequest = require("xmlhttprequest ...
Read more >
How to fix error TS7016: Could not find a declaration file for ...
Try `npm install @types/XYZ` if it exists or add a new declaration (.d. · declare module 'XYZ';. Lastly, you also need to add...
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