inngest / inngest-js

The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
https://www.inngest.com/
GNU General Public License v3.0
414 stars 41 forks source link

Don't return a `Response` in `inngest/next` if in serverless #421

Closed jpwilliams closed 9 months ago

jpwilliams commented 9 months ago

Summary

Next.js versions next@>=13.0.0 <13.5.0 will throw an error if a Response object is returned from a serverless endpoint. next@>=13.5.0 will display the error but continue to function.

Next.js edge still requires that the ReturnType of the function is a Response, so we keep that type whilst ensuring it's not actually passed back in serverless endpoints.

There are so many edge cases here and this one breaks across minor versions. Separate exports (e.g. inngest/next-13-edge) might be appropriate in the future if the type/runtime guards continue to become stricter on the Next.js side.

Checklist

Related

changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: 94bd507446f94b56283af52ded3feb5c50bd6965

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------- | ----- | | inngest | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR