Skip to content

Transform error Syntax error Dev server returned response error 500 #21930

@PurnimaNaik

Description

@PurnimaNaik

I have this really weird issue, when I try running my app using react-native run-android. Its a brand new project. I have only modified one Text component. This is how the code looks in App.js-

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Hello Race!</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});

The error I am getting is this-

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false

Body:
{"type":"TransformError","lineNumber":19,"column":5,"filename":"/Users/"System-name"/"Project-name"/App.js","errors":[{"description":"SyntaxError: /Users/"System-name"/"Project-name"/App.js: Unexpected token, expected \";\" (19:5)\n\n\u001b[0m \u001b[90m 17 | \u001b[39m})\u001b[33m;\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 18 | \u001b[39m\u001b[0m\n\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 19 | \u001b[39mtype \u001b[33mProps\u001b[39m \u001b[33m=\u001b[39m {}\u001b[33m;\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m    | \u001b[39m     \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 20 | \u001b[39m\u001b[36mexport\u001b[39m \u001b[36mdefault\u001b[39m \u001b[36mclass\u001b[39m. . . . 
![screenshot_1540413705](https://user-images.githubusercontent.com/33334848/47460177-e2d83600-d7ab-11e8-8731-e0ca66a1abd5.png)

I had been trying to integrate Wix's RNN, and got all those issues out of the way, then had issues with babel, I downloaded the right presets and got that working too.

I didn't edit the App.js other than that one line - <Text style={styles.welcome}>Hello Race!</Text>

What syntax error is it pointing to? I don't think there is any syntax error in App.js. Please help!

screenshot_1540413705

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions