Emitted 'error' event on WriteStream instance
See original GitHub issueWhat 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.
info - Creating an optimized production build .events.js:291
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, open 'D:\[...]\.next\trace'
Emitted 'error' event on WriteStream instance at:
at D:\[...]\node_modules\next\dist\compiled\@vercel\nft\index.js:1:287421
at D:\[...]\node_modules\next\dist\compiled\@vercel\nft\index.js:1:287860
at FSReqCallback.oncomplete (fs.js:164:23) {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'D:\\[...]\\.next\\trace'
}
Expected Behavior
I expect it to work when building
To Reproduce
clone the with-typescript example, run npm run dev
and once done npm run build
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Emitted 'error' event on WriteStream instance - next.js
When making a build for production, I keep getting this error. I never had the issue before upgrading to version 12.0. 0. I...
Read more >Node.js Readable Stream error Event - GeeksforGeeks
The 'error' event in Readable stream can be emitted at any time. It takes place when the hidden stream is not able to...
Read more >emitted 'error' event on writestream instance at - You.com
The 'error' event in Readable stream can be emitted at any time. It takes place when the hidden stream is not able to...
Read more >NodeJS writeStream 'Einval' error when running in crontab ...
Error: EINVAL: invalid argument, open 'my path goes here'' Emitted 'error' event on WriteStream instance at: at internal/fs/streams.js:361: ...
Read more >Newbie getting build errors with Next.JS : r/reactjs - Reddit
... open 'C:\Users\Simon\Desktop\@Documents\@@Projects\Coding\@web\portfolio\.next\trace' Emitted 'error' event on WriteStream instance at: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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).you just need to stop the npm run dev and then run npm run build, that works for me