Skip to content

fix(nextjs): Move server-only resolution to runtime #3761

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

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

LauraBeatris
Copy link
Member

Description

#3758 introduces an issue where server-only gets resolved when importing any module from @clerk/nextjs/server. An example of that is that the error gets thrown when using getAuth from getServerSideProps.

This PRs moves the server-only resolution to runtime within auth and currentUser.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@LauraBeatris LauraBeatris self-assigned this Jul 18, 2024
Copy link

changeset-bot bot commented Jul 18, 2024

🦋 Changeset detected

Latest commit: 6f71552

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

This PR includes changesets to release 1 package
Name Type
@clerk/nextjs 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

@LauraBeatris LauraBeatris force-pushed the move-server-only-error-to-runtime branch from 7507e56 to e149817 Compare July 18, 2024 19:46
@LauraBeatris LauraBeatris marked this pull request as ready for review July 18, 2024 19:58
@LauraBeatris LauraBeatris requested review from a team and tmilewski July 18, 2024 19:58
@LauraBeatris LauraBeatris changed the title fix(nextjs) Move server-only resolution to runtime fix(nextjs): Move server-only resolution to runtime Jul 18, 2024
@LauraBeatris LauraBeatris changed the title fix(nextjs): Move server-only resolution to runtime fix(nextjs): Move server-only resolution to runtime Jul 18, 2024
@LauraBeatris LauraBeatris enabled auto-merge (squash) July 18, 2024 20:07
@LauraBeatris LauraBeatris disabled auto-merge July 18, 2024 20:08
@LauraBeatris LauraBeatris force-pushed the move-server-only-error-to-runtime branch from c62df84 to 6f71552 Compare July 18, 2024 20:12
@LauraBeatris LauraBeatris enabled auto-merge (squash) July 18, 2024 20:18
@LauraBeatris LauraBeatris merged commit b8e3129 into main Jul 18, 2024
16 checks passed
@LauraBeatris LauraBeatris deleted the move-server-only-error-to-runtime branch July 18, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants