TypeError: undefined is not a function, js engine: hermes (React Native)

Viewed 38

I'm trying to make a request to the local database using watermelondb using react-native. I've already done it once, but for some reason, when using this function, that is identical to the other one I've made (and it works), it gives me this error: TypeError: undefined is not a function, js engine: hermes. But the error is too generalistic, and I don't see any reasons for this to be wrong. Here's a piece of the code:

        saveCompetitor({
            competitorName,
            color,
            arSample,
            compliesWith,
            demand,
            enforcement,
            environment,
            packaging,
            prep,
            productDescription,
            substratum,
            workmanship,
            customer

        });

It throws an error, in the exactly first line (pointing at the first Parenthesis).

I'm getting this function using:

const {saveCompetitor} = useCompetitorContext();

And its interface is:

interface CompetitorContextData {
    error?: string;
    loading: boolean;
    saveCompetitor: ({competitorName, productDescription, workmanship, color, packaging, demand, environment, compliesWith, substratum, prep, enforcement, arSample, customer}: SaveCompetitorProps) => void;
}

Thanks so much for your help!

EDIT: For some reason, now it's throwing the same error, but on a different part of the code (node modules): Here's the image

0 Answers
Related