Next.js: Next.js hangs on build when using WSL

Created on 31 Jul 2018  路  4Comments  路  Source: vercel/next.js

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.

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.

All 4 comments

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

wsl

@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

Was this page helpful?
0 / 5 - 0 ratings