(CLI) Netlify dev, in local development doesn't build on request time the static pages

Hello All,

We are using the Netlify cli to boot up a local Node.js server during our local development. On our productions sites we’ve some static page created during the build, but for most of the pages we still proxying to our back-end servers

Reading from documentation about Next.js (may be we misunderstood) we understood working locally on some of the static pages, every time a request it’s made on these static pages it’s built on-fly to check our changes, not being needed to build manually the page. But using Netlify cli with the dev option we’ve noticed that it’s proxying the request to the local backend server instead of build the static page and serve it.

The only way we’ve found for now it’s to run the build locally with Netlify build and then pass to the Netlify dev the output path, but it’s not very time efficient every time you do a change on the code having to build the entire site, and rerun the local server.

Is Netlify dev able to build in request time the static pages during the local development like Netx.js does?
May be we’ve something wrong on our configuration?

Thanks

The problem is not with Netlify CLI but rather Next.js’ dev server. Netlify CLI simply sends the incoming request to your app’s dev server and send you the response that if got from that server. Consider CLI as a middle-person.

So if Next.js can build the pages as you need, CLI will get those automatically.