Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Feb 9, 2026

Summary

  • Add /* turbopackIgnore: true */ magic comment alongside existing /* webpackIgnore: true */ on the dynamic import('@clerk/ui/entry') in the Next.js ClerkProvider
  • The webpackIgnore comment prevents webpack from statically resolving the optional @clerk/ui dependency at build time, but Turbopack does not recognize it — causing the bare specifier to reach the browser and fail with TypeError: Failed to resolve module specifier '@clerk/ui/entry'
  • Turbopack added support for turbopackIgnore in next.js#69768 (available since Next.js 15 RC.2), so using both comments ensures the import is skipped by both bundlers when @clerk/ui is not installed

Test plan

  • Verify ui prop works in a Next.js app with Turbopack (Next.js 16 default)
  • Verify build succeeds in a Next.js app without @clerk/ui installed (no regression from webpack)
  • CI integration tests pass for both Next.js 15 and 16

@vercel
Copy link

vercel bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Feb 10, 2026 0:47am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

🦋 Changeset detected

Latest commit: 6493721

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

The Next.js ClerkProvider.tsx client code was adjusted to change how the optional @clerk/ui/entry is dynamically imported: the import now includes both webpackIgnore and turbopackIgnore magic comments and the @ts-expect-error comment was updated to note @clerk/ui is an optional peer dependency. No runtime control flow or public API signatures were changed; lazy loading behavior remains.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding turbopackIgnore directive to the dynamic import for Turbopack compatibility. It is concise, specific, and clearly summarizes the primary fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 9, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7805

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7805

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7805

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7805

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7805

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7805

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7805

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7805

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7805

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7805

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7805

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7805

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7805

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7805

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7805

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7805

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7805

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7805

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7805

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7805

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7805

commit: 6493721

@jacekradko jacekradko changed the title fix(nextjs): Remove webpackIgnore from @clerk/ui dynamic import fix(nextjs): Add turbopackIgnore to @clerk/ui dynamic import for Turbopack compatibility Feb 9, 2026
@jacekradko jacekradko merged commit 1a72784 into main Feb 10, 2026
39 checks passed
@jacekradko jacekradko deleted the jrad/fix-turbopack-ui-import branch February 10, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants