Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
How do you fix require() is not defined in JS if there are no files, and no HTML?

I'm trying to make an AI text generator (using an API) and it says "ReferenceError: require is not defined", and I don't have a package JSON or HTML outside of it because I'm running it from a Snap! JavaScript function reporter. Any ideas? I've thought of putting a function in the variable box, but I don't know what goes in there. Code:

const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML

deepai.setApiKey('quickstart-QUdJIGlzIGNvbWluZy4uLi4K');

(async function() {
    var resp = await deepai.callStandardApi("text-generator", {
            text: "YOUR_TEXT_HERE",
    });
    console.log(resp);
})()

almost 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!