3

I am continuously running into this error while trying to learn react native. The app will run fine and then I make some additions and it breaks and shows this error:

error message

The code that is producing it is:

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

const App = () => {
  return (
    <View>
      <Text>Hello</Text>
    </View>
  );
};

const styles = StyleSheet.create({});

export default App;

Any information would be awesome, I just want a consistent dev environment to be able to work in. I have looked through similar posts however they all seem to already have functioning projects when receiving this error.

yaboi-hugh
  • 163
  • 3
  • 10

3 Answers3

4

The fix is that it was a problem with the react-native debugger that apparently just happens sometimes, disable the debugger with ctr+m on the android device and debug using node command line or third party debugger

yaboi-hugh
  • 163
  • 3
  • 10
1

Running below command fixed the issue for me.

cd android
./gradlew clean
Anupam Chaplot
  • 1,134
  • 1
  • 9
  • 22
0

I have faced similar issue. Apparently, my react native debugger is trying to reference a module from previous react native folder. (That time, I created 2 same react native folder, one as a backup. In case I messed up with the coding)

In order to fix this, I have to clear the react native cache. I found my answer in this post.

Lolz
  • 51
  • 1
  • 2