Skip to content

Conversation

JakeChampion
Copy link
Contributor

depends on https://github.com/netlify/serverless-functions-api/pull/385

this gives us the ability to catch any errors which may arise when importing the function's code, and also allows us to prepare more within the bootstrapping phase before the functions code is executed - such as populating process.env or any bootstrapping that may require information provided by Proxy for the invocation

…funcion inside request handler

this gives us the ability to catch any errors which may arise when importing the function's code,
and also allows us to prepare more within the bootstrapping phase before the functions code is
executed - such as populating process.env or any bootstrapping that may require information
provided by Proxy for the invocation
@JakeChampion JakeChampion marked this pull request as ready for review May 7, 2025 13:45
@JakeChampion JakeChampion requested a review from a team as a code owner May 7, 2025 13:45
Comment on lines +56 to +57
`import * as bootstrap from './${BOOTSTRAP_FILE_NAME}'`,
`export const handler = bootstrap.getLambdaHandler('${importPath}')`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation changes the signature of bootstrap.getLambdaHandler() from accepting a module object to accepting a path string. Make sure the corresponding implementation in the bootstrap file has been updated to handle this new signature, otherwise this will cause runtime errors.

@JakeChampion JakeChampion merged commit 63a89a5 into main May 7, 2025
34 checks passed
@JakeChampion JakeChampion deleted the jake/dynamic-function-import branch May 7, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants