Closed sergiohgz closed 6 months ago
I get the same issue when running tests such as playwright on a self-hosted runner in Github actions..
For those also hitting this issue on windows, I was able to work around this by running in an administrator powershell.
next info
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.16.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 13.4.14-canary.1
eslint-config-next: 13.4.12
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.6
Next.js Config:
output: N/A
Same issue with npm and yarn too. Tested at 20-canary.0
Any solution for this?
I have the same issue. It is probably related to somewhere here: https://github.com/vercel/next.js/pull/35535, https://github.com/vercel/next.js/discussions/40482 & https://github.com/vercel/next.js/discussions/52244. Context is from next-config-standalone.
It is probably a good idea to consider multiple fallback procedures for Windows builds. My configuration works without issue on Docker based environment node:18-alpine
on CI/CD Platform and in local docker build on Windows. It seems that the issue is related to symlink
.
I'm no expert in this area but it seems pnpm
has multiple methods described on .npmrc
configuration package-import-method=auto|hardlink|copy|clone|clone-or-copy
. Maybe an implementation that is something similar to that for tracing output standalone linking?
I'm using turbo@1.10.16-canary.1
pnpm@8.9.0
along with:
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.18.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 13.5.5-canary.15
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 4.9.5
Next.js Config:
output: standalone
Hello, will there be someone working on this issue please? I am also facing the issue on Windows with standalone output. Thank you.
There were few windows specific fixes in v14, does anyone still have that issue after upgrading to v14?
Yes, I am currently with 14.0.2 experiencing this. As a workaround for the moment, I need to use node-linker in hoisted mode instead of isolated, which is sad.
In my case, this issue occurs on output: "standalone"
.
https://github.com/vercel/next.js/blob/4125069840ca98981f0e7796f55265af04f3e903/packages/next/src/build/utils.ts#L1957
It seems like fs.symlink
is not supported ideally at Windows (at least at mine).
I fixed it by enabling Windows Developer Mode
Running into a similar but slightly different issue. I have my Yarn PnP project saved on a file server mapped to the Z: drive. When I run yarn build
I get:
⚠ Failed to copy traced files for Z:\Documents\Programming\redis-app-nextjs\.next\server\pages\_app.js [Error: ENOENT: no such file or directory, mkdir 'Z:\Documents\C:'] {
errno: -4058,
code: 'ENOENT',
syscall: 'mkdir',
path: 'Z:\\Documents\\C:'
}
In my case, this issue occurs on
output: "standalone"
.It seems like
fs.symlink
is not supported ideally at Windows (at least at mine). I fixed it by enabling Windows Developer Mode
It work for me too, thanks man ✋
In my case, this issue occurs on
output: "standalone"
.It seems like
fs.symlink
is not supported ideally at Windows (at least at mine). I fixed it by enabling Windows Developer Mode
Tried from my side this and the problem is resolved. Thank you so much @AhmedBaset !!
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
Operating System (Windows, MacOS, Linux), Package manager (npm, pnpm, Yarn), Standalone mode (output: "standalone")
Link to the code that reproduces this issue or a replay of the bug
https://github.com/sergiohgz/nextjs-docker-pnpm-windows-issue
To Reproduce
Using Windows:
Describe the Bug
When using Windows and output standalone with pnpm, project doesn't build due to symlinks errors. Tried using several configurations, like node-linker=hoisted, and issue persist.
The final output when script clones necessary dependencies to standalone folder shows something similar to:
Expected Behavior
Using Windows, Next.js project should compile when using output standalone like in other systems.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response