vercel avatar

React Vendoring

If you're touching React vendoring in Next.js or working around the react-server layer boundary, you need this. Next.js doesn't pull React from node_modules for App Router. It vendors stable and experimental builds into packages/next/src/compiled/ during build. The tricky part is entry-base.ts: it's the only file compiled in the react-server layer, so all Flight server API imports must route through it or you'll hit "react-server condition must be enabled" errors in production (dev mode hides this). The skill covers the webpack aliasing setup, type declarations in $$compiled.internal.d.ts, and the boundary rules that will save you from runtime failures.

skills.sh installs
945
GitHub stars
139.5K
last updated
May 16, 2026

Install

$ npx -y skills add vercel/next.js --skill react-vendoring --agent claude-code

Installs into .claude/skills of the current project.

Files

React Vendoring

Use this skill for changes touching vendored React, react-server-dom-webpack/*, or react-server layer boundaries.

App Router Vendoring

React is NOT resolved from node_modules for App Router. It's vendored into packages/next/src/compiled/ during pnpm build (task: copy_vendor_react() in taskfile.js). Pages Router resolves React from node_modules normally.

  • Two channels: stable (compiled/react/) and experimental (compiled/react-experimental/). The runtime bundle webpack config aliases to the correct channel via makeAppAliases({ experimental }).

entry-base.ts Boundary

Only entry-base.ts is compiled in rspack's (react-server) layer. ALL imports from react-server-dom-webpack/* (Flight server/static APIs) must go through entry-base.ts. Other files like stream-ops.node.ts or app-render.tsx must access Flight APIs via the ComponentMod parameter (which is the entry-base.ts module exposed through the app-page.ts build template).

Sponsors

Details

Repository
github.com/vercel/next.js
Categories
Frontend Development, Cloud & Infrastructure
First seen
Apr 16, 2026

More from vercel/next.js

All 14
1remix-run avatarreact-router-data-moderemix-run/agent-skillsreact router data mode914skills.sh installs
2syncfusion avatarsyncfusion-react-treegridsyncfusion/react-ui-components-skillsImplements Syncfusion React TreeGrid for hierarchical data with sorting, filtering, editing, exporting, paging, virtual scrolling, and advanced features. Suppor771skills.sh installs
3syncfusion avatarsyncfusion-react-licensesyncfusion/react-ui-components-skillsUse this skill when the user asks about Syncfusion React licensing, license keys, license registration, license validation errors, trial licenses, or license tr744skills.sh installs
4syncfusion avatarsyncfusion-react-notificationssyncfusion/react-ui-components-skillsComprehensive guide for implementing Syncfusion React Notification components including Badge, Message, Skeleton, Toast, and Spinner. Use this when applying sta684skills.sh installs
5syncfusion avatarsyncfusion-angular-licensesyncfusion/angular-ui-components-skillsUse this skill when the user asks about Syncfusion Angular licensing, license keys, license registration, license validation errors, trial licenses, or license 330skills.sh installs
6emilkowalski avatarpick-ui-libraryemilkowalski/skillsPick the right library for a given frontend task from a curated, opinionated list — numbers, OTP inputs, charts, command menus, virtualization, drag and drop, t218.9Kskills.sh installs