nitrojs / nitrojs/nitro

Cloudflare Pages build fails. Cannot resolve "unenv/runtime/node/process/index/"

Open
#2,631 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment
  • nitropack@2.9.7
  • readable-stream@4.4.0
Reproduction

Run build in Stackblitz

Made from starter template and adding readable-stream

Describe the bug

Unable to build for Cloudflare Pages with readable-stream

Additional context

Related Issues

Logs
[12:58:23 AM]  ERROR  Cannot resolve "unenv/runtime/node/process/index/" from "/home/ryoid/nitro-cfpages-unenv-repo/node_modules/.pnpm/readable-stream@4.4.0/node_modules/readable-stream/lib/internal/streams/pipeline.js" and externals are not allowed!

  at Object.resolveId (node_modules/.pnpm/nitropack@2.9.7/node_modules/nitropack/dist/nitro.mjs:2003:17)
  at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:19733:28)
  at async resolveId (node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:18414:26)
  at async ModuleLoader.resolveId (node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:18817:15)
  at async PluginDriver.hookFirstAndGetPlugin (node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:19733:28)
  at async resolveId (node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:18414:26)
  at async ModuleLoader.resolveId (node_modules/.pnpm/rollup@4.19.0/node_modules/rollup/dist/es/shared/node-entry.js:18817:15)
  at async eval (node_modules/.pnpm/@rollup+plugin-commonjs@25.0.8_rollup@4.19.0/node_modules/@rollup/plugin-commonjs/dist/es/index.js:800:16)
  at async eval (node_modules/.pnpm/@rollup+plugin-commonjs@25.0.8_rollup@4.19.0/node_modules/@rollup/plugin-commonjs/dist/es/index.js:792:32)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the StackBlitz reproduction and its Cloudflare Pages build with readable-stream@4.4.0. Trace the unresolved import from readable-stream/lib/internal/streams/pipeline.js through nitropack/dist/nitro.mjs, then verify that the build completes without the unenv/runtime/node/process/index/ error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.