Uncaught SyntaxError c:\Users\user\Dropbox\PC\Downloads\captcha\app.ts:1import { solveCaptcha } from "nocaptchaai-puppeteer";^^^^^^SyntaxError: Cannot use import statement outside a module
Bananawhat02 opened this issue · comments
Hello,
Code : `ts
import { solveCaptcha } from "nocaptchaai-puppeteer";
import puppeteer from "puppeteer";
const URL = "https://accounts.hcaptcha.com/demo";
const API_KEY = "animalescrossingosda"; // <-- your API key here
const UID = "animalescrossingosda-6ab13ff2-c94c-6a36-3b5d-e0dd16e4e918"; // <-- your UID here
const main = async (): Promise => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto(URL);
await page.waitForNetworkIdle();
await solveCaptcha(page, API_KEY, UID, "free");
await page.screenshot({ path: "test.jpeg", type: "jpeg" });
await browser.close();
};
main();`
Error : Uncaught SyntaxError c:\Users\user\Dropbox\PC\Downloads\captcha\app.ts:1
import { solveCaptcha } from "nocaptchaai-puppeteer";
^^^^^^
SyntaxError: Cannot use import statement outside a module
Some issues are fixed with the example. Can you reproduce this bug?