Error: Cannot find module '@sparticuz/chromium
See original GitHub issueI followed the instruction to create layer and attach it to the lambda function however I am still getting following error.
Test Event Name
event
Response
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module '@sparticuz/chromium'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/index.mjs",
"trace": [
"Runtime.ImportModuleError: Error: Cannot find module '@sparticuz/chromium'",
"Require stack:",
"- /var/task/index.js",
"- /var/runtime/index.mjs",
" at _loadUserApp (file:///var/runtime/index.mjs:951:17)",
" at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:976:21)",
" at async start (file:///var/runtime/index.mjs:1137:23)",
" at async file:///var/runtime/index.mjs:1143:1"
]
}
Function Logs
Unknown application error occurred
Runtime.ImportModuleError
2022-10-08T07:11:45.439Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '@sparticuz/chromium'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '@sparticuz/chromium'","Require stack:","- /var/task/index.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:951:17)"," at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:976:21)"," at async start (file:///var/runtime/index.mjs:1137:23)"," at async file:///var/runtime/index.mjs:1143:1"]}
2022-10-08T07:13:35.744Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module '@sparticuz/chromium'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/index.mjs","stack":["Runtime.ImportModuleError: Error: Cannot find module '@sparticuz/chromium'","Require stack:","- /var/task/index.js","- /var/runtime/index.mjs"," at _loadUserApp (file:///var/runtime/index.mjs:951:17)"," at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:976:21)"," at async start (file:///var/runtime/index.mjs:1137:23)"," at async file:///var/runtime/index.mjs:1143:1"]}
START RequestId: 688c27ef-4936-4ebb-b55b-4f03edaad219 Version: $LATEST
END RequestId: 688c27ef-4936-4ebb-b55b-4f03edaad219
REPORT RequestId: 688c27ef-4936-4ebb-b55b-4f03edaad219 Duration: 1426.51 ms Billed Duration: 1427 ms Memory Size: 128 MB Max Memory Used: 12 MB
Unknown application error occurred
Runtime.ImportModuleError
Request ID
688c27ef-4936-4ebb-b55b-4f03edaad219
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:12 (5 by maintainers)
Top Results From Across the Web
How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
In my case, I got it like this "Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\user\Desktop\Projects\Address Locator\ ...
Read more >Error: Cannot find module 'bcrypto.node' · Issue #127 - GitHub
i got some error here D:\DataGalang\test-cepot\hs-airdrop\node_modules\loady\lib\loady.js:156 throw err; ^ Error: Cannot find module ...
Read more >@sparticuz/chrome-aws-lambda - npm
Chromium Binary for AWS Lambda and Google Cloud Functions, forked from @alixaxel/chrome-aws-lambda. Latest version: 17.1.3, last published: ...
Read more >[Solution] Error: Cannot Find Module "nodemailer" - Courier
This is a common Nodemailer error -- get the solution for Error: Cannot Find Module "nodemailer".
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 FreeTop 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
Top GitHub Comments
I’m on a mac and it unzipped both of them, which is why it took me a while to stumble into this issue. For a split second I can see both of them expanding
If I go to the terminal and use
unzip chromium.zip -d temp
it will only unzip the first one.I’m going to close this issue as it’s easily solved by following these instructions.
https://github.com/Sparticuz/chromium#aws-lambda-layer