Next.js is a popular React framework for building server-rendered, static and dynamic web applications.
Laravel Forge is an awesome server deployment tool mostly used for Laravel applications.
The Laravel Forge team has written an article on how to get a Next.js application deployed to Forge. That article is here:
Looking at inspect element it became obvious that something is amiss. This was the output on the console:
Googling ‘buildManifest.js’ and 404 pointed to many results in Google, which made me think something fundamental is amiss. Finally it turns out the deployment advice on the article is this:
cd /home/forge/next-app-static.curved-feather.test git pull origin $FORGE_SITE_BRANCH npm install
Whereas in fact I also had to restart the node server, like this:
My conclusion is that after every
git push command, the static assets are recompiled and they have new files names. Without refreshing the server those new pages don’t show.