like-gold
like-gold2y ago

Playwright & Typescript GCP Cloud Build Error

I am getting the following error in my build logs when deploying to GCP using the instructions from the documentation. Is this a known issue? am I missing anything?
node_modules/@crawlee/browser-pool/playwright/playwright-browser.d.ts:12:22 - error TS2420: Class 'PlaywrightBrowser' incorrectly implements interface 'Browser'.
Property '[Symbol.asyncDispose]' is missing in type 'PlaywrightBrowser' but required in type 'Browser'.

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

node_modules/playwright-core/types/types.d.ts:16581:3
16581 [Symbol.asyncDispose](): Promise<void>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'[Symbol.asyncDispose]' is declared here.
node_modules/@crawlee/browser-pool/playwright/playwright-browser.d.ts:12:22 - error TS2420: Class 'PlaywrightBrowser' incorrectly implements interface 'Browser'.
Property '[Symbol.asyncDispose]' is missing in type 'PlaywrightBrowser' but required in type 'Browser'.

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

node_modules/playwright-core/types/types.d.ts:16581:3
16581 [Symbol.asyncDispose](): Promise<void>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'[Symbol.asyncDispose]' is declared here.
1 Reply
like-gold
like-goldOP2y ago
Fixed by ignoring the bulk of errors via my tsconfig.json Specifically added the following (indicated by + sign) to the overrides...
{
"extends": "@apify/tsconfig",
"compilerOptions": {
"module": "ES2022",
"target": "ES2022",
"outDir": "dist",
+ "noUnusedLocals": false,
+ "noUnusedParameters": false,
+ "strict": false,
"skipLibCheck": true,
"lib": ["DOM"]
},
"include": [
"./src/**/*"
]
}
{
"extends": "@apify/tsconfig",
"compilerOptions": {
"module": "ES2022",
"target": "ES2022",
"outDir": "dist",
+ "noUnusedLocals": false,
+ "noUnusedParameters": false,
+ "strict": false,
"skipLibCheck": true,
"lib": ["DOM"]
},
"include": [
"./src/**/*"
]
}

Did you find this page helpful?