Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/auth-misimport-runtime-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/nextjs": patch
---

Improved developer experience when `auth` is accidentally imported from `@clerk/nextjs` instead of `@clerk/nextjs/server`. The `auth` export now includes a `@deprecated` JSDoc tag with a clear message guiding developers to the correct import path, visible on hover in IDEs.
2 changes: 1 addition & 1 deletion packages/nextjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const ClerkProvider = ComponentsModule.ClerkProvider as ServerComponentsS
export const Show = ComponentsModule.Show as ServerComponentsServerModuleTypes['Show'];

/**
* `auth` is not available from this import path.
* @deprecated `auth()` must be imported from `@clerk/nextjs/server`, not `@clerk/nextjs`.
*
* **To fix this error:**
* ```diff
Expand Down
Loading