Quantcast
Channel: Active questions tagged require - Stack Overflow
Viewing all articles
Browse latest Browse all 166

Can't find variable: require at global code@

$
0
0

I'm new to JavaScript and was trying to import the Google Gemini library to use its AI. However, I'm facing an issue when I use the "require" keyword:

ERROR: Can't find variable: require at global code@

Here is the code that throws this error:

const {    GoogleGenerativeAI,    // HarmCategory,    // HarmBlockThreshold,  } = require("@google/generative-ai");

Viewing all articles
Browse latest Browse all 166

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>