Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] pnpm symlink compatibility #414

Open
ha1fstack opened this issue Feb 25, 2025 · 0 comments
Open

[BUG] pnpm symlink compatibility #414

ha1fstack opened this issue Feb 25, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@ha1fstack
Copy link
Contributor

ha1fstack commented Feb 25, 2025

Describe the bug

┌──────────────────────────────┐
│ OpenNext — Generating bundle │
└──────────────────────────────┘

Bundling middleware function...
Bundling static assets...
Bundling cache assets...
Building server function: default...
node:fs:3086
  binding.copyFile(
          ^

Error: EPERM: operation not permitted, copyfile '...\.next\standalone\node_modules\.pnpm\[email protected]\node_modules\@img\sharp-wasm32' -> '...\.open-next\server-functions\default\node_modules\.pnpm\[email protected]\node_modules\@img\sharp-wasm32'
    at copyFileSync (node:fs:3086:11)
    at file:///.../node_modules/.pnpm/@opennextjs+aws@https+++pkg.pr.new+@opennextjs+aws@748/node_modules/@opennextjs/aws/dist/build/copyTracedFiles.js:140:13
    at Map.forEach (<anonymous>)
    at copyTracedFiles (file:///.../node_modules/.pnpm/@opennextjs+aws@https+++pkg.pr.new+@opennextjs+aws@748/node_modules/@opennextjs/aws/dist/build/copyTracedFiles.js:111:17)
    at generateBundle (file:///.../node_modules/.pnpm/@opennextjs+cloudflare@https+++pkg.pr.new+@opennextjs+cloudflare@[email protected]_@cl_kqmgsg5g3b7oqvmpys6frm3g2a/node_modules/@opennextjs/cloudflare/dist/cli/build/open-next/createServerBundle.js:106:11)
    at createServerBundle (file:///.../node_modules/.pnpm/@opennextjs+cloudflare@https+++pkg.pr.new+@opennextjs+cloudflare@[email protected]_@cl_kqmgsg5g3b7oqvmpys6frm3g2a/node_modules/@opennextjs/cloudflare/dist/cli/build/open-next/createServerBundle.js:66:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async build (file:///.../node_modules/.pnpm/@opennextjs+cloudflare@https+++pkg.pr.new+@opennextjs+cloudflare@[email protected]_@cl_kqmgsg5g3b7oqvmpys6frm3g2a/node_modules/@opennextjs/cloudflare/dist/cli/build/build.js:74:5)
    at async file:///.../node_modules/.pnpm/@opennextjs+cloudflare@https+++pkg.pr.new+@opennextjs+cloudflare@[email protected]_@cl_kqmgsg5g3b7oqvmpys6frm3g2a/node_modules/@opennextjs/cloudflare/dist/cli/index.js:7:1 {
  errno: -4048,
  code: 'EPERM',
  syscall: 'copyfile',
  path: '...\\.next\\standalone\\node_modules\\.pnpm\\[email protected]\\node_modules\\@img\\sharp-wasm32',
  dest: '...\\.open-next\\server-functions\\default\\node_modules\\.pnpm\\[email protected]\\node_modules\\@img\\sharp-wasm32'
}

Node.js v22.14.0

Steps to reproduce

  • pnpm latest, node lts, windows
  • nextjs starter template

pnpm with node-linker=isolated breaks build

  1. throws EPERM error while build
  2. node_modules folder gets corrupted so have to reinstall dependency from scratch everytime I build

If switched to node-linker=hoisted so symlink is disabled, the problems are gone

tested on windows only, guess other platforms are fine

Expected behavior

  • build should work
  • node_modules folder should be intact

@opennextjs/cloudflare version

latest stable / canary

Wrangler version

3.109.3

next info output

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Education
  Available memory (MB): 65278
  Available CPU cores: 24
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.5.0
Relevant Packages:
  next: 15.1.7 // Latest available version is detected (15.1.7).
  eslint-config-next: 15.1.7
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: N/A

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Development

No branches or pull requests

1 participant