The development server returned a response error code: 500 in the response native

I am using react-native framework to develop my android application. I want to use the react-native-material-design library to create a Toolbar with some additional features.

I installed this library in the current directory where my project uses the following command: -

 E:\>npm i react-native-material-design -g --save C:\Users\ch-e00925\AppData\Roaming\npm `-- react-native-material-design@0.3.7 +-- react-native-material-design-styles@0.2.6 (git+https://github.com/react-n ative-material-design/react-native-material-design-styles.git#bdc029c1a1c83ff563 d10868be38b8aed1e9989b) `-- react-native-vector-icons@2.1.0 +-- lodash@4.17.4 `-- yargs@4.8.1 +-- cliui@3.2.0 | +-- strip-ansi@3.0.1 | | `-- ansi-regex@2.1.1 | `-- wrap-ansi@2.1.0 +-- decamelize@1.2.0 +-- get-caller-file@1.0.2 +-- lodash.assign@4.2.0 +-- os-locale@1.4.0 | `-- lcid@1.0.0 | `-- invert-kv@1.0.0 +-- read-pkg-up@1.0.1 | +-- find-up@1.1.2 | | +-- path-exists@2.1.0 | | `-- pinkie-promise@2.0.1 | | `-- pinkie@2.0.4 | `-- read-pkg@1.1.0 | +-- load-json-file@1.1.0 | | +-- graceful-fs@4.1.11 | | +-- parse-json@2.2.0 | | | `-- error-ex@1.3.0 | | | `-- is-arrayish@0.2.1 | | +-- pify@2.3.0 | | `-- strip-bom@2.0.0 | | `-- is-utf8@0.2.1 | +-- normalize-package-data@2.3.5 | | +-- hosted-git-info@2.1.5 | | +-- is-builtin-module@1.0.0 | | | `-- builtin-modules@1.1.1 | | +-- semver@5.3.0 | | `-- validate-npm-package-license@3.0.1 | | +-- spdx-correct@1.0.2 | | | `-- spdx-license-ids@1.2.2 | | `-- spdx-expression-parse@1.0.4 | `-- path-type@1.1.0 +-- require-directory@2.1.1 +-- require-main-filename@1.0.1 +-- set-blocking@2.0.0 +-- string-width@1.0.2 | +-- code-point-at@1.1.0 | `-- is-fullwidth-code-point@1.0.0 | `-- number-is-nan@1.0.1 +-- which-module@1.0.0 +-- window-size@0.2.0 +-- y18n@3.2.1 `-- yargs-parser@2.4.1 `-- camelcase@3.0.0 E:\> 

After that, I have one problem when starting the application, maybe the library was not installed successfully.

 E:\Myntra>react-native start Scanning 557 folders for symlinks in E:\Myntra\node_modules (114ms) β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Running packager on port 8081. β”‚ β”‚ β”‚ β”‚ Keep this packager running while developing on any JS projects. Feel β”‚ β”‚ free to close this tab and run your own packager instance if you β”‚ β”‚ prefer. β”‚ β”‚ β”‚ β”‚ https://github.com/facebook/react-native β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Looking for JS files in E:\Myntra [01/23/2017, 13:36:07] <START> Initializing Packager [01/23/2017, 13:36:08] HMR Server listening on /hot React packager ready. [01/23/2017, 13:36:12] <START> Requesting bundle bundle_url: /index.android.bundle?platform=androi d&dev=true&hot=true&minify=false [01/23/2017, 13:36:40] <START> Building Haste Map [01/23/2017, 13:36:40] <END> Building Haste Map (141ms) [01/23/2017, 13:36:40] <END> Initializing Packager (33314ms) [01/23/2017, 13:36:40] <START> Transforming files transformed 584/607 (96%)(node:6316) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 605): UnableToResolveError: Unable to resolve module react-native-material-design-styles from E:\Myntra\node_modules\react-nat ive-material-design\lib\config.js: Module does not exist in the module map or in these directories: E:\Myntra\node_modules\react-native-material-design\node_modules , E:\Myntra\node_modules This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following: 1. Clear watchman watches: `watchman watch-del-all`. 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`. 3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cac he`. [01/23/2017, 13:54:09] <START> Requesting bundle bundle_url: /index.android.bundle?platform=androi d&dev=true&hot=true&minify=false 

PS: I am on a computer with Windows 7, could not find a way to execute commands. I saw this The development server responded to the response error code: 500 in the response-native , but that did not help me.

Can someone help me solve this problem. Thanks in advance.

enter image description here

+20
android react-native react-native-android
source share
14 answers

try installing react-native-material-design locally, not globally.

It seems that action-native-material-design depends on the response-native-material-design-styles style, which will not be packaged by the React Native bundler, since its parent is a global module.

+5
source share

babel-preset-react-native make this problem. Run the below orders in the project root directory:

$ yarn remove babel-preset-react-native

$ yarn add babel-preset-react-native@2.1.0

+9
source share

Someday this error occurs if you did not specify the correct path to the .js files

As instead of entering the line Correct :

 var WeatherProject = require('./Main/WeatherProject'); 

A Wrong Way to be typed (capitalization, spelling error, special characters):

 var WeatherProject = require('./WeatherProject'); 
+4
source share

I had the same problem with port 8081, replace it with 8082. because it is already being used by some other service, this is a step after me

Start your batch server first: Blockquote

 react-native start --port 8082 

Open another command line, start the Android application as usual:

 react-native run-android 

Once this is over, now rewrite the tcp port that adb tunnels:

 adb reverse tcp:8081 tcp:8082 

See a list of adb tcp tunnels:

 adb reverse --list 

You should now see a message like:

 (reverse) tcp:8081 tcp:8082 

check your application, it will work ...........!

+3
source share

One of the reasons I had this error was because I imported the β€œresponsive native” library twice.

 import { View, Text, ActivityIndicator } from "react-native"; import { View, Text, ActivityIndicator, TouchableOpacity, StyleSheet } from "react-native"; 

I don't know if this can really cause this problem, but removing the redundant import string solved this problem for me.

+2
source share

First, run to get the version number:

 C:\WINDOWS\system32>react-native -v react-native-cli 

2.0.1 reactive: 0.56.0

Then I deleted the native reaction

 C:\WINDOWS\system32>npm uninstall -g react-native-cli 

removed 41 packages for 3.999s

Then I installed the reagent-native:

 npm install react-native@0.55.4 

Then I set the reaction-native-Cli:

 npm install -g react-native-cli@1.2.0 

Then use this setting to create a reactive project:

 react-native init --version="0.55.4" myprojectname 
+2
source share

Whenever someone gets this kind of error with error code 500. Following this reason.

1) You can work on the Linux system and run the application with the terminal and register in Android Simulator, and not in Devices.

2) If you are working with the above, then please make sure that your Simulator Wife must be turned off, and then work with Studio. She will work just fine.

Hope you get a solution.

+2
source share

Being new to React-native, I often came across this error and was always confused. However, after some experience, I realized that this happens when the server tries to import something from a non-existent place.

Thus, checking that everything you import, and if this thing exists at all, should be where you should start.

This means that this error appears not only for the uninstalled package or so, but even if you import the wrong place or the wrong place.

+1
source share

1) You can work on the Linux system and run the application with the terminal and register in Android Simulator, and not in Devices.

2) If you are working with the above, then please make sure your Simulator Wifi is turned off, and then work with Studio. It will work just fine.

3) Make sure that there should not be an open terminal or command window at the same time. if he then closes

+1
source share

Maybe the name of the JavaScript files you imported is the same for any React React predefined libraries / components. For example, import View.js from the application / components folder you created.

 import View from './app/components/View' 

The above statement will cause an error. So by changing the file name to Interface.js

 import Interface from './app/components/Interface' 

Code can now work well

0
source share

If you are using the response version: 56.0, then downgrade it to version 54. It worked for me

0
source share

For those who use stores or top-level components. If you delete one, make sure it has not been imported elsewhere.

In my case, I deleted the store, which was imported to the top level.

0
source share

native package - platform android - dev false - input file index.js - output-android / app / src / main / assets / index.android.bundle --assets-dest android / app / src / main / RES

run this command: it will show an error like double closing tags or inability to find any module

use sudo before command on Linux based systems

0
source share
  • Go to your root project
  • Open PowerShell
  • Run npm start —–reset-cache
  • When this is done, do not close it and at the same time do not open another PowerShell in the root directory of your project.
  • Run react-native run-android
0
source share

All Articles