{ const user = { email" /> { const user = { email" /> { const user = { email"/>

Why am I getting "ReferenceError: Property 'axios' doesn't exist, js engine: hermes" when I try to register a new user?

195 Views Asked by At

The part of the code that is causing the problem has the following syntax:

import axios from "axios";

const handleLogin = () => {
        const user = {
            email:email,
            password:password,
        };

        axios.post("http://localhost:8082/login", user).then((response) =>{
            const token = response.data.token;
            AsyncStorage.setItem("authToken",token);
            router.replace("/(tabs)/home")
        }) 

    }

Here are the errors presented both in cmd and in the application:

enter image description here enter image description here

After researching what could be due to the syntax, but even after changing it, there was no solution to the problem. Any idea how I resolve this?

1

There are 1 best solutions below

1
Aniket Gupta On

The error message you're encountering, "property axios does not exist," it seems that the axios module is not properly imported into your file or it is not recognized in your environment.

Check if it is properly installed, you can check in pacakge.json

npm install axios

import axios from 'axios';