How can I enable hot-reloading/auto-rebuilding nextjs app when using local server run with "netlify dev"?

I’m a bit of a newbie to netlify and NextJS, so I’m mostly looking for advice with regards to how to properly set up a development environment for Netlify.

As far as I can tell, and from what it sounds like from other posts, I should be able to use the “netlify dev” or “netlify dev --live” commands to create a dev server that can automatically deploy as I make changes to my code.
However, while both commands will start the server, build my code, and open the browser to show the newly built app, nothing happens when I make further changes to my code.
I don’t see any particular error messages related to building the app or netlify that could indicate what is happening, as Netlify does not seem to output anything to the terminal when I make changes to my code, and additionally the build proceeds just fine if I simply close the process and start it again with “netlify dev” or “netlify dev --live”.

I can use npm to do this by running “npm run dev”, wherein a local server is set up, and the app is built automatically. From there, when new code changes are saved, the app is recompiled and the page refreshes automatically to reveal new changes.
Unfortunately, this doesn’t work for me since my website uses Netlify functions to connect to an external database, so I need to use Netlify’s tools to achieve this.

If there is any more useful information that I should share, please let me know.

Hey @genericallynamed,

Is this related to you by any chance:

Hi,

In my case, I can see the local server start and the page becomes viewable. However, when I make any changes to my code, none of the output from the server seems to acknowledge these changes, and I am not sure how to get the website on the local server to update without restarting the server. If what the post is describing is similar to my issue, then it might be related.

Since it should be noted, I am running Node 16.15.1 and Netlify-CLI 10.5.1 on Ubuntu in WSL2. Apologies for not clarifying this sooner. Is it possible that I could try a different version to see if the issue is resolved, and if so, which version of Node/Netlify should I try?

Hey @genericallynamed,

Netlify CLI usually launches your site’s development server and simply proxies what that server is showing. So, if your site’s development server is showing the changes, Netlify CLI would show too and vice versa.

Could you confirm if your site’s server which most likely would have started on localhost:3000 is showing those changes? If that is showing it correctly and Netlify CLI is not, it would be a bug and would need to be reported on the CLI repo.