When using asyncData
and generate full static pages, I found some generated pages (npm run generate
) have missing data loaded via asyncData
.
- This problem doesn't appear in development, only in
npm run generate
- The generated static pages should have embed the data loaded via
asyncData
in the html files, but somehow those data are missing.
The culprit is generate.routes
in nuxt.config.js
, when you have path which didn't start with /
.
export default { generate: { routes: [ '/', '/page/2', 'page/3' // this page will have missing data, as the path doesn't start with / ] }}
NOTE: Tested on Nuxt v2.14.6