react-vendoring

>

INSTALLATION
npx skills add https://github.com/vercel/next.js --skill react-vendoring
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

$27

Adding Node.js-Only React APIs

These exist in .node builds but not in the type definitions. Steps:

  • Add type declarations to $$compiled.internal.d.ts.
  • Export the API from entry-base.ts behind a process.env guard.
  • Access it via ComponentMod in other files.
// In entry-base.ts (react-server layer) only:

/* eslint-disable import/no-extraneous-dependencies */

export let renderToPipeableStream: ... | undefined

if (process.env.__NEXT_USE_NODE_STREAMS) {

  renderToPipeableStream = (

    require('react-server-dom-webpack/server.node') as typeof import('react-server-dom-webpack/server.node')

  ).renderToPipeableStream

} else {

  renderToPipeableStream = undefined

}

/* eslint-enable import/no-extraneous-dependencies */

// In other files, access via ComponentMod:

ComponentMod.renderToPipeableStream!(payload, clientModules, opts)

ESLint Practical Rule

For guarded runtime require() blocks that need import/no-extraneous-dependencies suppression, prefer scoped block disable/enable. If using eslint-disable-next-line, the comment must be on the line immediately before the require() call, NOT before the const declaration. When the const and require() are on different lines, this is error-prone.

Turbopack Remap

react-server-dom-webpack/* is silently remapped to react-server-dom-turbopack/* by Turbopack's import map. Code says "webpack" everywhere, but Turbopack gets its own bindings at runtime. This affects debugging: stack traces and error messages will reference the turbopack variant.

Related Skills

  • $flags - flag wiring (config/schema/define-env/runtime env)
  • $dce-edge - DCE-safe require patterns and edge constraints
  • $runtime-debug - reproduction and verification workflow
BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card