That’s weird, because from my understanding, publish folder should have not have any technical effect on this. I don’t think any SSG actually renders the development build to the publish folder. I know one - Hugo, that does it if you explicitly ask it to, not otherwise. So, the development server never really reads files from the publish folder.
But even if it does, I don’t see how it would affect caching. Are you clearing the contents of the out folder before starting the server?
At least intentionally I’m not clearing the contents of the folder. When I was trying to find the issue, I did it once or twice, with no success on solving the problem.
If it doesn’t read from the /out folder, how does it render the components? Really newbie here
That’s interesting. I had seen a similar case but it was a Hugo website. Check it out here:
Netlify CLI sets up a proxy to your SSG’s development server, which is why it starts 2 servers - your SSG’s development server and it’s own server. The ‘own’ server takes the request → sends it to the SSG’s server → receives a response from there → sends it back to the original requestor (in most cases the browser). So, I don’t think NextJS renders the content to the out folder when you run its development server which is why I said, that’s not from where CLI is reading the content.