-1

I am having a issue on react native. This is my first time using so I am following a guide from https://www.youtube.com/watch?v=f6TXEnHT_Mk. According to the video, after npm start, I am suppose to arrive with a browser opened that look like: enter image description here

But it did not happen on my laptop. When I tried to copy the link in the terminal to a browser, I get this instead:

enter image description here

Can anyone explain to me what did I do wrong? I have double checked everything and is the same as the video till this point. In the video for this to appear the window defender firewall was blocking the feature so the user allow access for that. But my firewall seems to not be blocking it

Having error logging in expo via terminal: enter image description here Solved

I am currently following a guide which is from https://www.youtube.com/watch?v=ql4J6SpLXZA

I am doing the login UI and around the 8 min mark, i decided to take a short break. After coming back, I continued till the 9 min mark and i am met with this:

enter image description here

Tried to remove the code I newly added but the problem still did not go away.

Referring to Unable to resolve "../../App" from "node_modules/expo/AppEntry.js", tried to add

"sourceExts": [ "js", "json", "ts", "tsx", "jsx", "vue"]

in the app.json file but I do not have the packageOpts line in the file. How do i solve this? Solved

I am still following the guide above: https://www.youtube.com/watch?v=ql4J6SpLXZA.

Now I am having issue with firebase. As stated in the video, it is for firebase 8 and I am using firebase 9 so I used the code provided by firebase:

// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
const firebaseConfig = {
  apiKey: "AIzaSyDI9Ggk4h-bHBSDjZAZgMaB6Ur_lvJIPKw",
  authDomain: "fypapp-4f10a.firebaseapp.com",
  projectId: "fypapp-4f10a",
  storageBucket: "fypapp-4f10a.appspot.com",
  messagingSenderId: "306492584822",
  appId: "1:306492584822:web:24b7ccb717a107df6b4057"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);

With this I was having an error of

Unable to resolve "idb" from "node_modules\@firebase\app\dist\esm\index.esm2017.js"

And I found a answer from online to bypass that by creating metro.config.js with the code: (This is for future user that is having trouble with this error)

const { getDefaultConfig } = require("@expo/metro-config");

const defaultConfig = getDefaultConfig(__dirname);

defaultConfig.resolver.assetExts.push("cjs");

module.exports = defaultConfig;

But now I am having another error when creating new user. I have the following error :

TypeError: undefined is not an object (evaluating '_firebase.auth.createUserWithEmailAndPassword')

I searched around stack and no one has post error of

evaluating '_firebase.auth.createUserWithEmailAndPassword`

Is there something I can do to solve this?

Another problem I have is regarding the styling for the page,

I have this currently: (When i never attempt to type anything new in the input boxes)

enter image description here

When i try to type something new in the input boxes:

enter image description here

I have the following code: How do i correct it so that my keyboard can be seen and the input boxes can be seen at the same time?

<KeyboardAvoidingView  //To prevent keyboard from blocking the writing area
        style={styles.container}
        behavior = "padding"
    >  
        <View style = {styles.inputContainer}> 
            <TextInput
                placeholder = "Email"
                value={email}
                onChangeText ={text => setEmail(text)}
                styles = {styles.input} 
            />         
            <TextInput
                placeholder = "Password"
                value={password}
                onChangeText ={text => setPassword(text)}
                styles = {styles.input} 
                secureTextEntry //Hide password
            />         
        </View>   
        
        <View style = {styles.buttonContainer}>
            <TouchableOpacity
                onPress = {() => { } }
                style = {styles.button}
            >
                <Text style={styles.buttonText}>Login</Text>
            </TouchableOpacity>
            <TouchableOpacity
                onPress = {handleSignUp}
                style = {[styles.button, styles.buttonOutline]}
            >
                <Text style={styles.buttonOutlineText}>Register</Text>
            </TouchableOpacity>
        </View>                       
    </KeyboardAvoidingView> 
Calvin Lin
  • 59
  • 1
  • 1
  • 7
  • Hi Calvin, this is a site for techincal questions with definitive answers, not opinion based answers, or for unfocused questions. Use google and read some articles instead – casraf Aug 27 '22 at 06:52
  • Sorry about that. I have changed the question – Calvin Lin Aug 27 '22 at 07:14

1 Answers1

1

Update July 25, 2022: expo-cli@6.0.0 has been released with the web UI removed. The last release to include the web UI is expo-cli@5.5.1.

You can check this article in medium for more details from here.

Or you can check this old question from here.

I prefer to change the tutorial to one newer or just skip this detail and continue :D

For expo login try run this two commands and try again:

npm cache clean --force 
npm install -g npm@latest --force
Louay Sleman
  • 1,794
  • 2
  • 15
  • 39
  • Thanks for the info about that! I have one more issue. I cannot log in via the terminal. Already registered one account but terminal doesn't allow me to log in. Is it possible for you to advice me on what I should do? PS: I post the snip in the same post as I am unable to create new question due to the down vote – Calvin Lin Aug 27 '22 at 09:01
  • 1
    try run this two commands and try again `npm cache clean --force` `npm install -g npm@latest --force` – Louay Sleman Aug 27 '22 at 09:15
  • Thanks! It work perfectly. I got one question about the app though. Sometime it can sync sometime it cannnot. How come? Like if i run it in my terminal gitbash i can. But when i run it in my visual code terminal, it cannot. And sometime when i run it in gitbash, it doesnt sync too. When i open app in my phone, my terminal dont have the line where it is generating the bundle. How do i deal with this? – Calvin Lin Sep 03 '22 at 06:25
  • Can you mark it as a correct answer please, and about the terminal can you add images or the error message you receive? – Louay Sleman Sep 03 '22 at 06:44
  • I just did it but is it possible to help me with a issue of mine again? I have edit the post. I am not allowed to post question thats why. For the terminal issue, theres no error or anything. In the phone it just stay the same screen even though i edit app.js. – Calvin Lin Sep 03 '22 at 08:34
  • Can you check this article: https://docs.expo.dev/workflow/run-on-device/ `npx expo start --tunnel` – Louay Sleman Sep 03 '22 at 10:24
  • Oh okay but how about the new error in my post? I still cannot figure out why is that happening – Calvin Lin Sep 03 '22 at 10:36
  • Just add `packageOpts` to the file like the image. – Louay Sleman Sep 03 '22 at 10:49
  • https://i.stack.imgur.com/54Kc9.png – Louay Sleman Sep 03 '22 at 10:50
  • Oh okay but i dont know why after one day it is okay already. No error. But now I have another issue, this is about linking up the firebase and also the styling. Is it possible to help me on this? Thank you very much ! – Calvin Lin Sep 06 '22 at 10:07
  • Can you ask it in another question? – Louay Sleman Sep 06 '22 at 17:08