I’ve been deploying a Nuxt version 2 build in the past couple of weeks but I recently stumbled into a configuration problem.
When using the following flags within the nuxt.config.js:
ssr: false,
target: static
The app dist
folder gets generated with files relying entirely from JS logic to fetch data within the client side, and after the deployment the app works perfectly fine except that if the user doesn’t have javascript enabled on his client the app doesn’t work at all (furthermore, it’s not a good experience for SEO reasons)
When using the following flags:
ssr: true,
target: static
The app dist
folder gets generated with all the content available within the html source (good!) but when deployed the routing is f**ked up, the navigation between pages doesn’t work but the URLs do update.
I tried changing <nuxt-link>
tags with <router-link>
but the output is exactly the same.
Note: when starting a local server with the above dist
everything works like a charm so it must be some shenaningan from Netlify configuration
netlify.toml:
[build]
command = "npm run generate"
publish = "dist/"
Unfortunately, I can’t provide the URL at this stage.