Skip to content

Conversation

@Tobbe
Copy link
Member

@Tobbe Tobbe commented Jul 11, 2025

For ESModule and CommonJS compatibility.
When using a bundler like Rollup, the handler function is exported as default.

This change defaults to a named handler export, just like before. But if an export like that can't be found it'll now also look for a default export with a handler property on it.

All credit for this one goes to @richard-stafflink who created the original PR over at redwoodjs/graphql#12064

rj-au and others added 2 commits July 11, 2025 08:29
For ESModule and CommonJS compatibility.
When using a bundler like Rollup, the handler function is exported as default.
@netlify
Copy link

netlify bot commented Jul 11, 2025

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit af2bc21
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6870b1e27c43c000081485f3

@Tobbe Tobbe added the release:fix This PR is a fix label Jul 11, 2025
@Tobbe Tobbe added this to the next-release-patch milestone Jul 11, 2025
@Tobbe Tobbe merged commit d0a0049 into main Jul 11, 2025
51 of 54 checks passed
@Tobbe Tobbe deleted the tobbe-richard-stafflink-api-server-lambdaLoader-import-fallbacks branch July 11, 2025 06:56
Tobbe added a commit that referenced this pull request Jul 11, 2025
For ESModule and CommonJS compatibility.
When using a bundler like Rollup, the handler function is exported as
`default`.

This change defaults to a named `handler` export, just like before. But
if an export like that can't be found it'll now also look for a
`default` export with a `handler` property on it.

All credit for this one goes to @richard-stafflink who created the
original PR over at redwoodjs/graphql#12064

---------

Co-authored-by: Richard J <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix This PR is a fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants