Next.js hangs on build when using WSL
Bug report
Describe the bug
Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10. Next.js will not build if you are building through WSL. Next.js will hang.
To Reproduce
- Run Windows 10 with WSL (Ubuntu)
- Try to build a Nextjs app
- Hangs with no feedback and no way to debug
https://github.com/zeit/next.js/issues/4647 https://github.com/zeit/next.js/issues/4647#issuecomment-399743230
Expected behavior
Next.js to run on WSL.
System information
- OS: Windows, Linux
Additional context
WSL works fine.
Closing this while i attempt to find a better reproduction case using create-next-app
I was building fine on WSL with Next 6. I just upgraded to 7 and now my build wont work. I use WSL to make builds with paths matching linux.
If anyone else is running into this, try disabling Real-time protection in Windows Defender Security Centre > Virus & threat protection > Virus & threat protection settings > Real-time protection. That finally solved it (albeit not the nicest solution) for me.
Inspired by https://medium.com/@leandrw/speeding-up-wsl-i-o-up-than-5x-fast-saving-a-lot-of-battery-life-cpu-usage-c3537dd03c74
@joelugh you can just add the working directory to the exclusion list of Windows Defender, still not optimal but less ugly than switching off real-time protection
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.