Open maximegheraille opened 2 years ago
Same error here, but different lines. Can't build 12.0.2.
info - Creating an optimized production build ...node:events:371
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, open 'D:\[...]\.next\trace'
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'D:\\[...]\\.next\\trace'
}
I might have found the problem. I used the with-typescript example. When running npm run buid
it works fine but when I have dev running via npm run dev
and I build it, it gives that error. Before version 12.0.0 is always had the dev running while doing a production build. (it was required for production build if I am not wrong)
@maximegheraille that is definitely helpful, I can see why that would indeed fail, note that it was never intended that next build
while next dev
is running would work, it's accidental that it worked before. There's other issues including shipping development bundles to production holding unminified code and such that would already exist in that case.
Not sure if we can detect next build
is running while in next dev
🤔
I'm able to reproduce the issue without running both simultaneously. I'm seeing the same error as well when running next dev
on a Windows machine. We run a reverse proxy at the same time as well and use a custom Express server (not sure if that helps narrow down the issue, just wanted to call it out 😄 )
you just need to stop the npm run dev and then run npm run build, that works for me
Para que usa o yarn é mesma coisa, só precisa parar yarn dev , depois executar yarn build
I might have found the problem. I used the with-typescript example. When running
npm run buid
it works fine but when I have dev running vianpm run dev
and I build it, it gives that error. Before version 12.0.0 is always had the dev running while doing a production build (it was required for production build if I am not wrong).
solved my problem thanks
Para que usa o yarn é mesma coisa, só precisa parar yarn dev , depois executar yarn build
Eu tenho que correr o servidor porque preciso da conexao com a API e por isso estou tendo o mesmo problema como faco para solucionar???
I might have found the problem. I used the with-typescript example. When running
npm run buid
it works fine but when I have dev running vianpm run dev
and I build it, it gives that error. Before version 12.0.0 is always had the dev running while doing a production build (it was required for production build if I am not wrong).
Solved! Thank you
你只需要停止 npm 运行开发,然后运行 npm 运行构建,这对我有用
完美解决
What version of Next.js are you using?
12.0.2
What version of Node.js are you using?
v14.11.0
What browser are you using?
chrome
What operating system are you using?
windows
How are you deploying your application?
next run build
Describe the Bug
Hi,
When making a build for production, I keep getting this error. I never had the issue before upgrading to version 12.0.0. I tried deleting the file, but it only works when the dev server is not running, while it runs I cannot open or delete it and that make every production build fail.
Expected Behavior
I expect it to work when building
To Reproduce
clone the with-typescript example, run
npm run dev
and once donenpm run build