Don't return a Response
in inngest/next
if in serverless
#421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Next.js versions
next@>=13.0.0 <13.5.0
will throw an error if aResponse
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 aResponse
, 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
Added a docs PR that references this PRN/A Bug fixAdded unit/integration testsN/A Will observe logs disappearing in current integration tests which use[email protected]
: https://github.com/inngest/inngest-js/actions/runs/7181668471/job/19556571083?pr=421Related
req.url
#400