Skip to content

Revert "feat(platform): Run middleware on node"#16685

Merged
chargome merged 1 commit into
masterfrom
revert-16642-cg/node-middleware
Mar 4, 2026
Merged

Revert "feat(platform): Run middleware on node"#16685
chargome merged 1 commit into
masterfrom
revert-16642-cg/node-middleware

Conversation

@chargome

@chargome chargome commented Mar 4, 2026

Copy link
Copy Markdown
Member

Reverts #16642

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

vercel Bot commented Mar 4, 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 5:42pm
sentry-docs Ready Ready Preview, Comment Mar 4, 2026 5:42pm

Request Review

@chargome
chargome requested a review from sergical March 4, 2026 17:31

@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.

const codeBlocks = (Array.isArray(children) ? [...children] : [children]).filter(
child => child?.props
);
const codeBlocks = Array.isArray(children) ? [...children] : [children];

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.

Removed filter allows children without props to crash

Medium Severity

The .filter(child => child?.props) guard was removed from codeBlocks, but line 58 immediately destructures {props: {title, language}} from each element via .map(). If any child in the array lacks a props property (e.g., a whitespace text node, null, or undefined from MDX rendering), this will throw a TypeError at runtime. This filter may have been a bug fix bundled into the reverted PR rather than part of the middleware feature itself.

Fix in Cursor Fix in Web

@chargome
chargome merged commit 494fb44 into master Mar 4, 2026
19 of 20 checks passed
@chargome
chargome deleted the revert-16642-cg/node-middleware branch March 4, 2026 17:42
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.

3 participants