Monday, May 20, 2024
88
rated 0 times [  90] [ 2]  / answers: 1 / hits: 6894  / 3 Years ago, sun, july 11, 2021, 12:00:00

I wrote a short code, basically copy paste of a tutorial, but for some reason when I try to use another js file, it gives me an error "None of these files exist" and a list of files.


I have includes a screenshort of the enite error here


My code is just the basic structure of a React-Native app, using the blank tamplate, my only addon was the "import GoogleAuth from "./assets/code";" and ""


import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import GoogleAuth from "./assets/code";

export default function App() {
return (
<View style={styles.container}>
<Text>Welcome to dogappcoolapp app</Text>
<GoogleAuth/>

<StatusBar style="auto" />
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});

and this is is GoogleAuth.js


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


function GoogleAuth(props) {
return (
<div>
<Button

title ="sign up with google"

/>
</div>
);
}

export default GoogleAuth;

is the, as you can see, the path seems correct so I don't know what can cause it, as in the tutorial I watched they did nothing difference (just with different names)


Why does it happen? I could not find any solution for it on gooogle, and I even went ahead and copy pasted a tutorial and got this error.


More From » react-native

 Answers
6

In your import GoogleAuth from "./assets/code" you are pointing to a folder not a module/js file. It is possible if you have index.js there but since it is not the case you should consider replacing it with
import GoogleAuth from "./assets/code/GoogleAuth.js"


[#1110] Monday, July 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
luna

Total Points: 698
Total Questions: 114
Total Answers: 93

Location: Israel
Member since Wed, Apr 14, 2021
3 Years ago
;