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.
https://github.com/zeit/next.js/issues/4647
https://github.com/zeit/next.js/issues/4647#issuecomment-399743230
Next.js to run on WSL.
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
Most helpful comment
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.