#Typescript Error using type `PlaywrightRequestHandler` in the latest Crawlee version

1 messages · Page 1 of 1 (latest)

steady moss
#

Just upgraded to 3.8.0 and my build process throws errors. Was working just fine before. What am I missing?

const xyzHandler: PlaywrightRequestHandler = async ({ request, page, enqueueLinks }) => {
}

const router = createPlaywrightRouter()
router.addHandler('xyz', xyzHandler)
Argument of type 'PlaywrightRequestHandler' is not assignable to parameter of type '(ctx: Omit<PlaywrightCrawlingContext<Dictionary>, "request"> & { request: Request<Dictionary>; }) => Awaitable<...>'.
  Types of parameters 'inputs' and 'ctx' are incompatible.
    Type 'Omit<PlaywrightCrawlingContext<Dictionary>, "request"> & { request: Request<Dictionary>; }' is missing the following properties from type 'PlaywrightCrawlingContext<Dictionary>': browserController, page, id, crawler, and 16 more.ts(2345)

Even doing something like router.addHandler('xyz', async ({ request, page, enqueueLinks }) => {}) just gets the request type, page and enqueueLinks are unknown.

charred vortex
#

Hi,
Thanks for reporting. We are aware of it and the fix is on the way)

For now, You can roll back to crawlee 3.7