Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: _$$_REQUIRE(_dependencyMap[4], "axios").post is not a function (it is undefined) #61

Open
muhammad-kumail opened this issue Jan 6, 2024 · 0 comments

Comments

@muhammad-kumail
Copy link

muhammad-kumail commented Jan 6, 2024

I'm using Clarifai in my React Native project. Essentially, I'm using react-native-camera to take a picture and then passing it to the Clarifai model to predict/identify objects in the picture. The picture is successfully taken and passed to the Clarifai model, but an error occurred in the following portion of the code.

    const Clarifai = require('clarifai');
    const app = new Clarifai.App({
      apiKey: 'my clarifai apiKey',
    });
    app.models
      .predict(Clarifai.GENERAL_MODEL, {base64: imageData})
      .then((response: any) =>
        displayAnswer(response.outputs[0].data.concepts[0].name),
      )
      .catch((err: any) => {
        alert(err);
        console.log('error:', err);
        setLoading(false);
      });

An error was caught in the .catch() statement. It seems like Axios is not imported correctly or the Axios package is not installed, but I have already installed the package. Below is my project's package.json dependencies:

    "axios": "^1.6.5",
    "clarifai": "^2.9.1",
    "react": "18.2.0",
    "react-native": "0.73.1",
    "react-native-camera": "^4.2.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant