Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

jpwilliams
Copy link
Member

@jpwilliams jpwilliams commented Dec 12, 2023

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

@jpwilliams jpwilliams added the Bug Something isn't working label Dec 12, 2023
@jpwilliams jpwilliams self-assigned this Dec 12, 2023
Copy link

changeset-bot bot commented Dec 12, 2023

🦋 Changeset detected

Latest commit: 94bd507

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

@inngest-release-bot inngest-release-bot added the 📦 inngest Affects the `inngest` package label Dec 12, 2023
@jpwilliams jpwilliams merged commit 471d11f into main Dec 12, 2023
33 checks passed
@jpwilliams jpwilliams deleted the fix/next-runtime-checks branch December 12, 2023 14:11
jpwilliams pushed a commit that referenced this pull request Dec 12, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Patch Changes

- [#421](#421)
[`471d11f`](471d11f)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Fix serverless
use of `inngest/next` with `next@>=13.0.0 <13.5.0` failing to return a
response, as well as `next@>=13.5.0` logging the same error

## @inngest/[email protected]

### Patch Changes

- [#419](#419)
[`4de1605`](4de1605)
Thanks [@jpwilliams](https://github.com/jpwilliams)! - Add the
encryption method used (`AES-256-CBC`) by default to the README

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working 📦 inngest Affects the `inngest` package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants