-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Following "Building Projects..." Docs Produces Error: "Development server returned response error code: 500" #21486
Comments
I see the same on macOS, but with a different dependency. Copy of error from the emulator:
Output of metro bundler:
It looks like it's trying to find dependencies at the wrong location. It's looking in |
Did you try: |
@ahardin I will attempt that right now and report back what it does. |
Seems to me that this bundler issue is the same as #21490, can you try the workaround described there, and if you recognize that the issue is the same please close this so that we can keep everyone on the other one and avoid redundancy? |
I tried adding babel to the runtime on the most recent release and it's working, and I didn't run into my second error. Will close the issue, but just to be explicit in the report of my solution; my issue was solved by @ahardin's suggestion to:
|
Replace package.json to:
Then follow this steps as is described in Link Go to your project directory and check if this folder exists android/app/src/main/assets From your root project directory do
Finally, navigate back to the root directory and check ii) If there are two files i.e Now run |
same error any update? |
run
rather than >react-native init MyProject |
I get this when trying to start a product flavor. |
Environment
React Native Environment Info:
System:
OS: Windows 7
CPU: x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Memory: 2.38 GB / 15.96 GB
Binaries:
Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.2.0.0 AI-181.5540.7.32.5014246
Description
After following the react-native guide to both setup my react-native app, and my android studio AVD, I have received my current error (I will paste it in full below).
Prior to posting I tried to search around, and couldn't find any recent solutions, or working ones. I had tried downgrading react-native to version 55,2, but ran into other errors. I have also tried the four steps the console produces (clear watchman, delete node_modules, etc). Other than what was installed with react-native init, I have no other dependencies.
package.json:
{
"name": "metronome",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.5.0",
"react-native": "0.55.2"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.47.0",
"react-test-renderer": "16.5.0"
},
"jest": {
"preset": "react-native"
}
}
Error:
The development server returned response error code: 500
URL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false
Body:
{"originModulePath":"C:\Code\Self-Projects\Metronome\nativeMetronome\index.js","targetModuleName":"@babel/runtime/helpers/interopRequireDefault","message":"Unable to resolve module
@babel/runtime/helpers/interopRequireDefault
fromC:\\Code\\Self-Projects\\Metronome\\nativeMetronome\\index.js
: Module@babel/runtime/helpers/interopRequireDefault
does not exist in the Haste module map\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 thenode_modules
folder:rm -rf node_modules && npm install
.\n 3. Reset Metro Bundler cache:rm -rf /tmp/metro-bundler-cache-*
ornpm start -- --reset-cache
.\n 4. Remove haste cache:rm -rf /tmp/haste-map-react-native-packager-*
.","errors":[{"description":"Unable to resolve module@babel/runtime/helpers/interopRequireDefault
fromC:\\Code\\Self-Projects\\Metronome\\nativeMetronome\\index.js
: Module@babel/runtime/helpers/interopRequireDefault
does not exist in the Haste module map\n\nThis might be related to https://github.com//issues/4968\nTo resolve try the following:\n 1. Clear watchman watches:watchman watch-del-all
.\n 2. Delete thenode_modules
folder:rm -rf node_modules && npm install
.\n 3. Reset Metro Bundler cache:rm -rf /tmp/metro-bundler-cache-*
ornpm start -- --reset-cache
.\n 4. Remove haste cache:rm -rf /tmp/haste-map-react-native-packager-*
."}],"name":"Error","stack":"Error: Unable to resolve module@babel/runtime/helpers/interopRequireDefault
fromC:\\Code\\Self-Projects\\Metronome\\nativeMetronome\\index.js
: Module@babel/runtime/helpers/interopRequireDefault
does not exist in the Haste module map\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 thenode_modules
folder:rm -rf node_modules && npm install
.\n 3. Reset Metro Bundler cache:rm -rf /tmp/metro-bundler-cache-*
ornpm start -- --reset-cache
.\n 4. Remove haste cache:rm -rf /tmp/haste-map-react-native-packager-*
.\n at ModuleResolver.resolveDependency (C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:209:1301)\n at ResolutionRequest.resolveDependency (C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:83:16)\n at DependencyGraph.resolveDependency (C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\node-haste\DependencyGraph.js:238:485)\n at Object.resolve (C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\lib\transformHelpers.js:180:25)\n at dependencies.map.result (C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\DeltaBundler\traverseDependencies.js:311:29)\n at Array.map ()\n at resolveDependencies (C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\DeltaBundler\traverseDependencies.js:307:16)\n at C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\DeltaBundler\traverseDependencies.js:164:33\n at Generator.next ()\n at step (C:\Code\Self-Projects\Metronome\nativeMetronome\node_modules\metro\src\DeltaBundler\traverseDependencies.js:266:307)"}processBundleResult
BundleDownloader.java:296
access$200
BundleDownloader.java:37
onResponse
BundleDownloader.java:174
execute
RealCall.java:153
run
NamedRunnable.java:32
runWorker
ThreadPoolExecutor.java:1162
run
ThreadPoolExecutor.java:636
run
Thread.java:764
Reproducible Demo
Follow this guide on a Windows 7 machine:
https://facebook.github.io/react-native/docs/getting-started.html
The text was updated successfully, but these errors were encountered: