noCaptchaAi / nocaptchaai-puppeteer

Puppeteer package for NoCaptchaAI (hCaptcha solver) ⚡️

Home Page:https://noCaptchaAI.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?