vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.35k stars 26.52k forks source link

The turbo package in nextjs 14 has a bug: EPERM: operation not permitted #57581

Closed peymanath closed 9 months ago

peymanath commented 10 months ago

Link to the code that reproduces this issue

https://github.com/peymanath/terxine/tree/nextjs14-turbo

To Reproduce

Hello everyone, i'm using Turbo in the developer environment nextjs14, but I'm getting the following error. Has anyone encountered this error?

Note: When I get this error that NEXTjs wants to render my routes.


   ▲ Next.js 14.0.0 (turbo)
   - Local:        http://localhost:3000

 ✓ Ready in 1161ms
 ○ Compiling /branchs/page ...
 ✓ Compiled /branchs/page in 3.9s
 ○ Compiling /_error ...
 ✓ Compiled /_error in 766ms
 ⨯ [Error: EPERM: operation not permitted, rename 'D:\Work\Development\Project\FrontEnd\Terxine\terxine\.next\build-manifest.json.tmp.jazqmzy5ees' -> 'D:\Work\Development\Project\FrontEnd\Terxine\terxine\.next\build-manifest.json'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'rename',
  path: 'D:\\Work\\Development\\Project\\FrontEnd\\Terxine\\terxine\\.next\\build-manifest.json.tmp.jazqmzy5ees',
  dest: 'D:\\Work\\Development\\Project\\FrontEnd\\Terxine\\terxine\\.next\\build-manifest.json'
}

Current vs. Expected behavior

When I use Turbo, this problem occurs and the fonts of my site do not load and the application does not work properly and it also gives this error, but without Turbopack there is no problem, the application works properly.

image

Verify canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 18.18.1
  npm: N/A
  Yarn: N/A
  pnpm: 8.9.2
Relevant Packages:
  next: 14.0.1-canary.0
  eslint-config-next: 14.0.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

App Router, Turbopack (--turbo)

Additional context

I am using version 13.5, today I wanted to change to 14 and use turbopack and I had this problem. I tested it when I use create-next-app, it works fine, but there is a problem with my project.

PACK-1956

IhsenBouallegue commented 10 months ago

same issue. Tried deleting the .next folder but didn't work. Sadly couldn't create a reproduction repo as I have a lot of code.

iojcde commented 10 months ago

Seeing similar errors here:

 ⨯ [Error: EPERM: operation not permitted, rename 'C:\Users\jcde0\dksh-website\.next\app-build-manifest.json.tmp.0jdcitichqov' -> 'C:\Users\jcde0\dksh-website\.next\app-build-manifest.json'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'rename',
  path: 'C:\\Users\\jcde0\\dksh-website\\.next\\app-build-manifest.json.tmp.0jdcitichqov',
  dest: 'C:\\Users\\jcde0\\dksh-website\\.next\\app-build-manifest.json'
}
 ⨯ [Error: EPERM: operation not permitted, rename 'C:\Users\jcde0\dksh-website\.next\server\middleware-build-manifest.js.tmp.oa55ccccoz' -> 'C:\Users\jcde0\dksh-website\.next\server\middleware-build-manifest.js'] {
  errno: -4048,
  code: 'EPERM',
  syscall: 'rename',
  path: 'C:\\Users\\jcde0\\dksh-website\\.next\\server\\middleware-build-manifest.js.tmp.oa55ccccoz',
  dest: 'C:\\Users\\jcde0\\dksh-website\\.next\\server\\middleware-build-manifest.js'
}

Fonts loaded by next/font/local returns 404 too.

Tajmirul commented 10 months ago

Same issue here. for now, i just removed --turbo.

tbenci commented 9 months ago

Adding --turbo is the main reason we've upgraded. NextJS is a slow old pig and need speeding up. If --turbo is not working why bother.

enricoros commented 9 months ago

Same here. I'm using the JetBrains IDE - does it have anything to do with this? Agree: --turbo is the reason to upgrade to NextJS 14 for me..

ForsakenHarmony commented 9 months ago

Is anyone running into this on an OS other than windows?

It's hard for us to reproduce without being on windows

ForsakenHarmony commented 9 months ago

Doing some research, this is a problem with windows specifically.

See: https://github.com/libuv/libuv/pull/1981

Antivirus might be locking the file preventing it from being renamed

So this isn't really a next.js bug, but we can add a retry to work around broken windows behaviour

peymanath commented 9 months ago

Doing some research, this is a problem with windows specifically.

See: libuv/libuv#1981

Antivirus might be locking the file preventing it from being renamed

So this isn't really a next.js bug, but we can add a retry to work around broken windows behaviour

I will check again

tbenci commented 9 months ago

Hi Vercel NextJS team,

This is very frustrating. I installed NextJS onto a bare bones Windows 11 machine with AVG antivirus. That's about it.

I have been working with NextJS for a while without any issues.

When I try to use --turbo, it doesn't work.

Obviously it is working for others but, it is also not working for others.

I am happy to do what every you suggest to try to fix this so tell us what to do.

Just saying it "might be antivirus" doesn't help much. What does that mean and what do we need to do to fix it.

A bit of direction would be most appreciated because all I can tell those that ask me is that --turbo doesn't work.

I tried it on my work machine on a completely different network, IP provider etc. and still it does not work.

github-actions[bot] commented 8 months ago

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.