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

fix(next): conditional RSC support #5745

Merged
merged 4 commits into from
Nov 7, 2022
Merged

fix(next): conditional RSC support #5745

merged 4 commits into from
Nov 7, 2022

Conversation

balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Nov 6, 2022

Fixes #5743

We accidentally broke Next.js 12 support via #5741 which has an import to next/headers that only exists in Next.js 13. This PR wraps the import into a conditional to prevent the error from happening in Next.js 12 apps.

☕️ Reasoning

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Please scout and link issues that might be solved by this PR.

Fixes: INSERT_ISSUE_LINK_HERE

📌 Resources

@vercel
Copy link

vercel bot commented Nov 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
next-auth ⬜️ Ignored (Inspect) Nov 6, 2022 at 6:06PM (UTC)

@github-actions github-actions bot added the core Refers to `@auth/core` label Nov 6, 2022
@balazsorban44 balazsorban44 changed the title fix(next): conditional RSC fix(next): conditional RSC support Nov 6, 2022
@github-actions
Copy link

github-actions bot commented Nov 6, 2022

🎉 Experimental release published 📦️ on npm!

pnpm add next-auth@0.0.0-pr.5745.7387139f
yarn add next-auth@0.0.0-pr.5745.7387139f
npm i next-auth@0.0.0-pr.5745.7387139f

Copy link
Member

@ThangHuuVu ThangHuuVu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the experimental, LGTM 🚢

@dominik-myszkowski
Copy link

Still the same error on 4.18.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting "Error: Cannot find module 'next/headers'" when accessing "api/auth/signin"
5 participants