Next.js Discord

Discord Forum

[Turbopack] Windows `next build` fails in standalone mode with `EINVAL: invalid argument, copyfile .

Unanswered
Lucy's Warbler posted this in #help-forum
Open in Discord
Lucy's WarblerOP
### Summary
When running next build with output: "standalone" on Windows using Turbopack (default in Next.js 16+ or explicitly enabled), the build fails during the file copying phase.

It attempts to copy a traced file for the node:inspector module, but the destination filename contains a colon (:), which is invalid on Windows filesystems.

This issue persists even in Next.js 16.1.6, despite PR #88273 (escape colon in output names) being merged.

### Reproduction Steps
1. Create a Next.js 16.1.6 project on Windows.
2. Enable output: "standalone" in next.config.ts.
4. Run next build.

### Error Log
> Build error occurred
Error: EINVAL: invalid argument, copyfile 'D:\path\to\.next\server\chunks\[externals]_node:inspector_7a4283c6._.js' -> 'D:\path\to\.next\standalone\apps\web\.next\server\chunks\[externals]_node:inspector_7a4283c6._.js'
    at ignore-listed frames {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'copyfile',
  path: 'D:\\path\\to\\.next\\server\\chunks\\[externals]_node:inspector_7a4283c6._.js',
  dest: 'D:\\path\\to\\.next\\standalone\\apps\\web\\.next\\server\\chunks\\[externals]_node:inspector_7a4283c6._.js'
}


### Environment
- OS: Windows (10/11)
- Next.js: 16.1.6
- Package Manager: pnpm
- Turbopack: Enabled

0 Replies