Hi, I’m trying to use Playwright in a Netlify function but I get this error on deploy (works great locally with
browserType.launch: Failed to launch chromium because executable doesn't exist at /home/sbx_user1051/.cache/ms-playwright/chromium-854489/chrome-linux/chrome Try re-installing playwright with "npm install playwright"Error at Object.captureStackTrace (/var/task/src/node_modules/playwright/lib/utils/stackTrace.js:48:19) at Connection.sendMessageToServer (/var/task/src/node_modules/playwright/lib/client/connection.js:69:48) at Proxy.<anonymous> (/var/task/src/node_modules/playwright/lib/client/channelOwner.js:64:61) at /var/task/src/node_modules/playwright/lib/client/browserType.js:64:67 at BrowserType._wrapApiCall (/var/task/src/node_modules/playwright/lib/client/channelOwner.js:77:34) at BrowserType.launch (/var/task/src/node_modules/playwright/lib/client/browserType.js:55:21) at Runtime.exports.handler (/var/task/src/functions/points-balance-get.js:19:38) at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)
I’ve try to empty cache, use
npm instead of
yarn but it does not work.
I tried to use the package
playwright-aws-lambda but it weights 44MB and with other modules, it exceeded the 66MB limit.
I also read this thread but it did not help: [Feature] Support for AWS Lambda / Serverless environments · Issue #2404 · microsoft/playwright · GitHub
Thanks for your help.