Skip to content

fix(e2e): skip middleware placement test on nextjs 16+#7758

Merged
jacekradko merged 5 commits intomainfrom
fix/middleware-placement-test-next16
Feb 4, 2026
Merged

fix(e2e): skip middleware placement test on nextjs 16+#7758
jacekradko merged 5 commits intomainfrom
fix/middleware-placement-test-next16

Conversation

@jacekradko
Copy link
Copy Markdown
Member

@jacekradko jacekradko commented Feb 4, 2026

Summary

Updates middleware placement tests to handle Next.js 16 canary's improved middleware detection:

  • src/app/middleware.ts test: Skip on Next.js 16 canary where middleware detection is smarter (Next 16 stable still shows the warning)
  • Add corresponding "Does not display misplaced middleware error on Next 16 canary" test for src/app/middleware.ts case

Failing test: https://github.com/clerk/javascript/actions/runs/21662200954/job/62449227128

Test plan

  • Nightly tests should pass with Next.js 16 canary
  • Existing tests continue to work with Next.js < 16

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 4, 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 4, 2026 3:36pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: 1051b1c

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

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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
Copy Markdown
Contributor

coderabbitai Bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Adds a new changeset metadata file .changeset/flat-eggs-stick.md containing two lines with ---. Updates integration/tests/middleware-placement.test.ts to introduce an internal helper isCanaryVersion(version) and canary-aware test logic. Several test flows now compute Next.js major and canary status, adjust skip conditions/messages, add a new test "Does not display misplaced middleware error on Next 16 canary", and include minor formatting tweaks.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: skipping middleware placement tests on Next.js 16+, which aligns with the changeset that adds canary-aware skip logic to the middleware placement test file.
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
Copy Markdown

pkg-pr-new Bot commented Feb 4, 2026

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 1051b1c

@jacekradko jacekradko changed the title fix(integration): skip middleware placement test on Next.js 16+ fix(e2e): skip middleware placement test on nextjs 16 canary Feb 4, 2026
@jacekradko jacekradko changed the title fix(e2e): skip middleware placement test on nextjs 16 canary fix(e2e): skip middleware placement test on nextjs 16+ Feb 4, 2026
Copy link
Copy Markdown
Member

@wobsoriano wobsoriano left a comment

Choose a reason for hiding this comment

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

thanks!

@jacekradko jacekradko merged commit aa2d3b5 into main Feb 4, 2026
43 checks passed
@jacekradko jacekradko deleted the fix/middleware-placement-test-next16 branch February 4, 2026 17:47
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.

3 participants