React create app hot reload is not always working on linux

后端 未结 9 1854
面向向阳花
面向向阳花 2020-12-24 12:03

I created a react application using create-react-app boilerplate, which seems to be very popular, hot reload some times updates when any of the files changes and some times

9条回答
  •  眼角桃花
    2020-12-24 12:43

    In unbuntu, i basically kill all the process running on port (for react app default is :3000).

    List all the process running on port 3000.

    lsof -i :3000

    This command will show something like this.

    COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
    node     7429 yipl   19u  IPv4 1081760      0t0  TCP localhost:3000->localhost:35762 (ESTABLISHED)
    chrome  26448 yipl  177u  IPv4 1080082      0t0  TCP localhost:35762->localhost:3000 (ESTABLISHED)
    

    Now kill the process by PID.

    kill -9 7429
    kill -9 26488
    

    Start your react app again.

提交回复
热议问题