[BUG] MODULE_NOT_FOUND in puppeteer-core - wrong path.
See original GitHub issueEnvironment
chrome-aws-lambda
Version: 5.2.0puppeteer-core
Version: 5.2.1- Lambda Runtime:
nodejs12.x
Expected Behavior
Returns: Example Domain
.
So it should not fail with MODULE_NOT_FOUND.
Current Behavior
Invoke Error
{
"errorType": "Error",
"errorMessage": "Cannot find module 'puppeteer-core/lib/cjs/common/Browser'\nRequire stack:\n- /var/task/node_modules/chrome-aws-lambda/source/puppeteer/lib/Browser.js\n- /var/task/node_modules/chrome-aws-lambda/source/index.js\n- /var/task/handler.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"code": "MODULE_NOT_FOUND",
"requireStack": [
"/var/task/node_modules/chrome-aws-lambda/source/puppeteer/lib/Browser.js",
"/var/task/node_modules/chrome-aws-lambda/source/index.js",
"/var/task/handler.js",
"/var/runtime/UserFunction.js",
"/var/runtime/index.js"
],
"stack": [
"Error: Cannot find module 'puppeteer-core/lib/cjs/common/Browser'",
"Require stack:",
"- /var/task/node_modules/chrome-aws-lambda/source/puppeteer/lib/Browser.js",
"- /var/task/node_modules/chrome-aws-lambda/source/index.js",
"- /var/task/handler.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)",
" at Function.Module._load (internal/modules/cjs/loader.js:842:27)",
" at Module.require (internal/modules/cjs/loader.js:1026:19)",
" at require (internal/modules/cjs/helpers.js:72:18)",
" at Object.<anonymous> (/var/task/node_modules/chrome-aws-lambda/source/puppeteer/lib/Browser.js:6:11)",
" at Module._compile (internal/modules/cjs/loader.js:1138:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)",
" at Module.load (internal/modules/cjs/loader.js:986:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:879:14)",
" at Module.require (internal/modules/cjs/loader.js:1026:19)"
]
}
Steps to Reproduce
Possible Solution
Correct the modules paths to match the current ones.
This is puppeteer-core/lib/cjs/puppeteer/common/Browser
etc.
Done in PR #157 !
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
puppeteer-core - npm
A high-level API to control headless Chrome over the DevTools Protocol. Latest version: 19.4.1, last published: 10 days ago.
Read more >How to fix issue "Error: Cannot find module 'puppeteer'" when ...
1 Answer 1 · I get an error: "Failed to launch the browser process" and that it cannot find the chrome.exe file on...
Read more >Getting to Know Puppeteer Using Practical Examples
Let's examine a few cases. Launching Chromium. The easiest way to interact with the browser is by launching a Chromium instance using Puppeteer: ......
Read more >Trying Lambda Functions with Puppeteer and getting Browser ...
Hey, I wasn't sure if this is related to Netlify or Puppeteer, but does someone know what's causing the following error: Browser is...
Read more >Troubleshooting - Puppeteer
If you get an error that looks like this when trying to launch Chromium: (node:15505) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello 😃 I’m using: “chrome-aws-lambda”: “^5.2.1”, “puppeteer-core”: “^5.2.1”, And still got the same error, which version should I use? The error I’m getting: Error: Cannot find module ‘/var/task/src/handlers/puppeteer/lib/Browser’
Just released v5.2.1 - sorry about the blunder! 😳