Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript shows missing modules/classes/interfaces incorrectly #34

Open
DjSt3rios opened this issue Oct 14, 2024 · 0 comments
Open

Typescript shows missing modules/classes/interfaces incorrectly #34

DjSt3rios opened this issue Oct 14, 2024 · 0 comments

Comments

@DjSt3rios
Copy link

Hello, I am using rebrowser-playwright package version 1.47.100, and I decided to convert my project to TypeScript.
While the code executes just fine, some classes are marked red and shows errors if I hover over them, and are a bit distracting.
An example code:

import playwright, {Browser} from "rebrowser-playwright";

async function run() {
    const browser: Browser = await playwright.chromium.launch({
        headless: false,
        channel: "chrome"
    });
    const page = await browser.newPage();
    await page.setViewportSize({ height: 1060, width: 1920});

    await page.goto('https://bot-detector.rebrowser.net', { waitUntil: 'domcontentloaded' });
    await new Promise((resolve) => setTimeout(resolve, 10000));
    await browser.close();
}

await run();

the "Browser" interface import is marked as an error by jetbrains IDE:
TS2305: Module "rebrowser-playwright" has no exported member Browser

at playwright.chromium.launch, the chromium keyword is also marked red, and shows this error when hovered:
TS2339: Property chromium does not exist on type "typeof import("C:/Users/user/IdeaProjects/playwright-real-browser/node_modules/rebrowser-playwright/index")"

It's not very important since the code runs, but it would be nice if it could be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant