Skip to content

feat(platform): Run middleware on node#16642

Merged
chargome merged 6 commits into
masterfrom
cg/node-middleware
Mar 4, 2026
Merged

feat(platform): Run middleware on node#16642
chargome merged 6 commits into
masterfrom
cg/node-middleware

Conversation

@chargome

@chargome chargome commented Mar 2, 2026

Copy link
Copy Markdown
Member

Switches the runtime for middleware invocations from edge to node.

ref https://vercel.com/changelog/middleware-now-supports-node-js

@chargome chargome self-assigned this Mar 2, 2026
@vercel

vercel Bot commented Mar 2, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Mar 4, 2026 0:40am
sentry-docs Ready Ready Preview, Comment Mar 4, 2026 0:40am

Request Review

Comment thread next.config.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread next.config.ts
},
experimental: {
nodeMiddleware: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Redundant experimental flag for stable Node.js middleware

Low Severity

The experimental.nodeMiddleware flag in next.config.ts is unnecessary with Next.js 15.5, where Node.js middleware is a stable feature. The runtime: 'nodejs' in the middleware config export (src/middleware.ts) is the only configuration needed. Having the redundant experimental flag suggests the feature is still experimental and may confuse future maintainers.

Fix in Cursor Fix in Web

Next.js 15.5 changed how React children are serialized during SSR,
which can result in child elements with undefined props being passed
to CodeTabs. Filter these out before destructuring.

Co-Authored-By: Claude <noreply@anthropic.com>
@chargome
chargome merged commit d877f69 into master Mar 4, 2026
19 checks passed
@chargome
chargome deleted the cg/node-middleware branch March 4, 2026 15:49
chargome added a commit that referenced this pull request Mar 4, 2026
chargome added a commit that referenced this pull request Mar 4, 2026
sergical added a commit that referenced this pull request Mar 4, 2026
Re-applies the changes from #16642 (reverted in #16685) with the env var
fix in place: middleware now falls back to NEXT_PUBLIC_DEVELOPER_DOCS
when DEVELOPER_DOCS_ isn't available at runtime.

Changes:
- Upgrade Next.js 15.1 → 15.5.12
- Enable experimental.nodeMiddleware in next.config.ts
- Set runtime: 'nodejs' in middleware config
- Move pages/ to root (required by Next.js 15.5 node middleware)
- Filter falsy children in CodeTabs (Next.js 15.5 compat)

Co-Authored-By: Claude <noreply@anthropic.com>
sergical added a commit that referenced this pull request Mar 4, 2026
Re-applies the changes from #16642 (reverted in #16685) with the env var
fix in place: middleware now falls back to NEXT_PUBLIC_DEVELOPER_DOCS
when DEVELOPER_DOCS_ isn't available at runtime.

Changes:
- Upgrade Next.js 15.1 → 15.5.12
- Enable experimental.nodeMiddleware in next.config.ts
- Set runtime: 'nodejs' in middleware config
- Move pages/ to root (required by Next.js 15.5 node middleware)
- Filter falsy children in CodeTabs (Next.js 15.5 compat)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants