Revert "feat(platform): Run middleware on node"#16685
Conversation
This reverts commit d877f69.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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.
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>
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>


Reverts #16642