Eltik / Puppeteer-Bypass

Bypassing CloudFlare's anti-bot challenge with Puppeteer optimizations
61 stars 8 forks source link

TypeError: API is not a constructor #6

Open rainb3rry opened 3 months ago

rainb3rry commented 3 months ago

Receiving this error

const bypass = new API();
               ^

TypeError: API is not a constructor

on this setup,

const API = require("./Puppeteer-Bypass/built/API");
const bypass = new API();

(
    async () => {
        const result = await bypass.request("https://accounts.shopify.com", { method: "GET"

        });

        console.log(result);
    }
)();

tried also with const API = require("./Puppeteer-Bypass/built/API").default; and

export class API {
,
export default class API {

on API.d.ts file..

any solutions?