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

[🐛 Bug]: Response mismatch when using bindings in development via next-dev #614

Open
1 task done
gcascio opened this issue Jan 6, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@gcascio
Copy link

gcascio commented Jan 6, 2024

next-on-pages environment related information

System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
CPU: (10) arm64 Apple M1 Pro
Memory: 16 GB
Shell: /bin/zsh
Package Manager Used: npm (9.6.7)

Relevant Packages:
@cloudflare/next-on-pages: 0.0.0-dd15930 (prerelease for PR #612)
vercel: 33.0.2
next: 14.0.4

Description

I encountered an issue while using NextAuth V5 while using setupDevBindings from the next-dev package which I believe is related to following patch:

runtimeContext['Response'] = Response;

I encounter the following error

TypeError: "response" must be an instance of `Response`

The origin of this error lies in the oauth4webapi package which is used by NextAuth and does the following check in multiple places:

if (!(response instanceof Response)) {
  throw new TypeError('"response" must be an instance of Response')
}

I assume there is a mismatch between the patched and unpatched Response somewhere.

Reproduction

I created a minimal reproduction here. The auth flow works when setupDevBindings is commented out but as soon as setupDevBindings is used the aforementioned error occurs.

Pages Deployment Method

None

Pages Deployment ID

No response

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant