Open shivika24 opened 2 years ago
I have the same error.
{
"errorType": "Error",
"errorMessage": "Error in handler: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (961656).",
"trace": [
"Error: Error in handler: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (961656).",
" at Runtime.module.exports.hello [as handler] (/var/task/handler.js:42:11)"
]
}
I had the same error. It seems it's because running this locally requires some additional steps: https://github.com/alixaxel/chrome-aws-lambda/wiki/HOWTO:-Local-Development
This explains why the chromium.executablePath is null, as it is not running in the lambda environment.
It's a seperate problem but now I'm seeing VAAPI video acceleration not available for swiftshader
errors when trying to run the instance.
node node_modules/puppeteer/install.js
node node_modules/puppeteer/install.js
i think this answer is right
I get it to work
node node_modules/puppeteer-core/install.js
version : "chrome-aws-lambda": "^10.1.0"
It works for me. Thank you.
node node_modules/puppeteer/install.js
node node_modules/puppeteer/install.js
Worked for me as well.
node node_modules/puppeteer/install.js
but how to use this?
node node_modules/puppeteer/install.js
but how to use this?
You execute the js file. Just copy paste the command into your console.
Give this a try. This is one of the latest maintained repositories: https://www.npmjs.com/package/@sparticuz/chromium. Working well with node 18 and AWS Lambda.
Give this a try. This is one of the latest maintained repositories: https://www.npmjs.com/package/@sparticuz/chromium. Working well with node 18 and AWS Lambda.
~/WebstormProjects/map-ts-gen/ [main+*] serverless invoke local --function mapgen -p data.json
Running "serverless" from node_modules
Compiling with Typescript...
Using local tsconfig.json - tsconfig.json
Typescript compiled.
{
"errorMessage": "spawn Unknown system error -8",
"errorType": "Error",
"stackTrace": [
"Error: spawn Unknown system error -8",
" at ChildProcess.spawn (node:internal/child_process:413:11)",
" at Object.spawn (node:child_process:757:9)",
" at childProcess.spawn (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/cli-progress-footer/lib/private/cli-progress-footer/disable-props.js:73:50)",
" at new Process (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/@puppeteer/browsers/lib/cjs/launch.js:143:87)",
" at launch (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/@puppeteer/browsers/lib/cjs/launch.js:80:12)",
" at ChromeLauncher.launch (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:90:54)",
" at async mapgen (/Users/leonardoviada/WebstormProjects/map-ts-gen/.build/handler.js:47:21)"
]
}
This is the instantiation code
const browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath(),
headless: chromium.headless,
});
I'm getting this error after switching to @sparticuz/chromium
So I run this command on the aws lambda instance? When I run this locally this seems to be a version tailored to my OS, which is different to the one that runs on aws lambda. Note that I do not use this locally but on a lambda instance (as the name of the package suggests). Thanks for any help
Give this a try. This is one of the latest maintained repositories: https://www.npmjs.com/package/@sparticuz/chromium. Working well with node 18 and AWS Lambda.
~/WebstormProjects/map-ts-gen/ [main+*] serverless invoke local --function mapgen -p data.json Running "serverless" from node_modules Compiling with Typescript... Using local tsconfig.json - tsconfig.json Typescript compiled. { "errorMessage": "spawn Unknown system error -8", "errorType": "Error", "stackTrace": [ "Error: spawn Unknown system error -8", " at ChildProcess.spawn (node:internal/child_process:413:11)", " at Object.spawn (node:child_process:757:9)", " at childProcess.spawn (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/cli-progress-footer/lib/private/cli-progress-footer/disable-props.js:73:50)", " at new Process (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/@puppeteer/browsers/lib/cjs/launch.js:143:87)", " at launch (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/@puppeteer/browsers/lib/cjs/launch.js:80:12)", " at ChromeLauncher.launch (/Users/leonardoviada/WebstormProjects/map-ts-gen/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:90:54)", " at async mapgen (/Users/leonardoviada/WebstormProjects/map-ts-gen/.build/handler.js:47:21)" ] }
This is the instantiation code
const browser = await puppeteer.launch({ args: chromium.args, defaultViewport: chromium.defaultViewport, executablePath: await chromium.executablePath(), headless: chromium.headless, });
I'm getting this error after switching to @sparticuz/chromium
Did you ever solve this? I'm been trying to solve this for 3+ hours and haven't had any success
node node_modules/puppeteer/install.js
but how to use this?
You execute the js file. Just copy paste the command into your console.
That works locally (telling me the browser is already installed):
➜ git:(main) node node_modules/puppeteer/install.js
Chromium is already in [...]/node_modules/puppeteer/.local-chromium/mac-901912; skipping download.
Still, the error remains on AWS lambda. I can't run that command there, or can I?
@kurtsys found any solution ?
node node_modules/puppeteer/install.js
but how to use this?
You execute the js file. Just copy paste the command into your console.
That works locally (telling me the browser is already installed):
➜ git:(main) node node_modules/puppeteer/install.js Chromium is already in [...]/node_modules/puppeteer/.local-chromium/mac-901912; skipping download.
Still, the error remains on AWS lambda. I can't run that command there, or can I?
did you solve this?
node node_modules/puppeteer/install.js
but how to use this?
You execute the js file. Just copy paste the command into your console.
That works locally (telling me the browser is already installed):
➜ git:(main) node node_modules/puppeteer/install.js Chromium is already in [...]/node_modules/puppeteer/.local-chromium/mac-901912; skipping download.
Still, the error remains on AWS lambda. I can't run that command there, or can I?
did you solve this?
node node_modules/puppeteer/install.js
Chromium is already in [...]/node_modules/puppeteer-core/.local-chromium/mac-1045629; skipping download.
I am getting same error. This happened after I installed chai
in my project.
It works for me. Thank you.
node node_modules/puppeteer/install.js
It also may be useful using: > > node node_modules/puppeteer/install.mjs
Could not find expected browser (chrome) locally. Run
npm install
to download the correct Chromium revision (938248). When using serverless-esbuild plugin with puppeteer.