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

Build fails for playwright crawlee initial setup #2693

Closed
1 task
jensmeichler opened this issue Oct 2, 2024 · 10 comments
Closed
1 task

Build fails for playwright crawlee initial setup #2693

jensmeichler opened this issue Oct 2, 2024 · 10 comments
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.

Comments

@jensmeichler
Copy link

Which package is this bug report for? If unsure which one to select, leave blank

None

Issue description

  1. Create a new project using npx crawlee create my-crawler
  2. Select the PlaywrightCrawler template project [TypeScript]
  3. Run npm run build or tsc

=> The build crashes with the following error:

> my-crawler@0.0.1 build
> tsc

node_modules/@crawlee/browser-pool/playwright/playwright-browser.d.ts:11:22 - error TS2420: Class 'PlaywrightBrowser' incorrectly implements interface 'Browser'.
  The types returned by 'removeAllListeners(...)' are incompatible between these types.
    Type 'this' is not assignable to type 'Promise<void>'.
      Type 'PlaywrightBrowser' is not assignable to type 'Promise<void>'.
        Type 'PlaywrightBrowser' is missing the following properties from type 'Promise<void>': then, catch, finally, [Symbol.toStringTag]

11 export declare class PlaywrightBrowser extends EventEmitter implements Browser {
                        ~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@crawlee/browser-pool/playwright/playwright-browser.d.ts:11

Code sample

No response

Package version

crawlee@3.11.4 playwright@1.47.2 tsx@4.19.1

Node.js version

v20.11.0

Operating system

macOS Sonoma 14.7

Apify platform

  • Tick me if you encountered this issue on the Apify platform

I have tested this on the next release

No response

Other context

No response

@jensmeichler jensmeichler added the bug Something isn't working. label Oct 2, 2024
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 2, 2024
@B4nan
Copy link
Member

B4nan commented Oct 2, 2024

this should be fixed in latest dev version, please try using that

@jensmeichler
Copy link
Author

jensmeichler commented Oct 2, 2024

I just tried again using the latest version but still getting the same issue:

Screenshot 2024-10-02 at 14 44 39

(Same result when using crawlee@next)

@B4nan
Copy link
Member

B4nan commented Oct 2, 2024

well, that is not the code from latest dev version, we no longer have the implements Browser in there.

https://unpkg.com/browse/@crawlee/browser-pool@3.11.5-beta.11/playwright/playwright-browser.d.ts

@B4nan
Copy link
Member

B4nan commented Oct 2, 2024

also i dont see where you update the dependency. its not enough to use dev version of the CLI to create new project (that will still use the very same templates, using stable versions), you need to update crawlee to dev version inside the created project.

@jensmeichler
Copy link
Author

Shouldn't this be enough? 😅
Screenshot 2024-10-02 at 14 52 28

(I did run npm i after changing it)
Still getting the error 😅

Or what did you mean with updating the deps?

@B4nan
Copy link
Member

B4nan commented Oct 2, 2024

yes, it should, but as i just showed you, the file is different from your screenshot, so you must be still using the old version

@B4nan
Copy link
Member

B4nan commented Oct 2, 2024

it works just fine with the dev version, so closing. we will be shipping new stable version soon, if you have troubles with the dev version, another option is to downgrade playwright, just pin it to the last 1.46 version, they did some breaking changes in 1.47 once again, that's why the build fails for you.

image

@B4nan B4nan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
@jensmeichler
Copy link
Author

Worked now :D Thank you for helping me out @B4nan

@j-d-carmichael
Copy link

I don't think this can be considered closed - the same issue persists when getting started from the docs:

https://crawlee.dev/docs/quick-start#installation-with-crawlee-cli

npx crawlee create my-crawler

@B4nan
Copy link
Member

B4nan commented Oct 4, 2024

as i said, this is fixed in master, we close issues when they get fixed, not when the fix is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

3 participants