You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use custom handler in my application to forward Cloudfront headers back to browser. I have the following code in serverless.json
"inputs": { "handler": "handler.handler",............}.
I have a file named handler.js in codebase and it exports method named handler. It has the logic to forward the CloudFront headers.
Custom handler gets added only for default & Api lambdas. The logic written in handler works. But ISR stopped working from then. I could see the following error for Regeneration lambda in cloudwatch. This gets logged frequently after adding handler:
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'handler'\nRequire stack:\n- /var/runtime/index.mjs",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module 'handler'",
"Require stack:",
"- /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"
]
}
This makes ISR to fail which is concern for my application. Is there an option to add handlers only for default lambda alone, or could we add handlers with out affecting Incremental Static Regeneration
Please advice
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I am trying to use custom handler in my application to forward Cloudfront headers back to browser. I have the following code in serverless.json
"inputs": { "handler": "handler.handler",............}.
I have a file named handler.js in codebase and it exports method named handler. It has the logic to forward the CloudFront headers.
Custom handler gets added only for default & Api lambdas. The logic written in handler works. But ISR stopped working from then. I could see the following error for Regeneration lambda in cloudwatch. This gets logged frequently after adding handler:
{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'handler'\nRequire stack:\n- /var/runtime/index.mjs",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module 'handler'",
"Require stack:",
"- /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"
]
}
This makes ISR to fail which is concern for my application. Is there an option to add handlers only for default lambda alone, or could we add handlers with out affecting Incremental Static Regeneration
Please advice
Thanks in advance.
The text was updated successfully, but these errors were encountered: