Mole
Mole
NNuxt
Created by Mole on 6/18/2024 in #❓・help
Nuxt Content Prerender takes long time
Hi! I am debugging our build pipeline which takes over 3 minutes for fairly small project (~500 components / 20ish pages). I have noticed the following in our docker build logs:
#14 78.35 [nitro] ℹ Initializing prerenderer
#14 99.64 [nitro] ℹ Prerendering 1 routes
#14 99.66 [nitro] ├─ /api/_content/cache.1718716099406.json (25ms)
#14 99.66 [nitro] ℹ Prerendered 1 routes in 21.148 seconds
#14 78.35 [nitro] ℹ Initializing prerenderer
#14 99.64 [nitro] ℹ Prerendering 1 routes
#14 99.66 [nitro] ├─ /api/_content/cache.1718716099406.json (25ms)
#14 99.66 [nitro] ℹ Prerendered 1 routes in 21.148 seconds
Nitro spent 21 seconds prerendering 1 content route. Upon inspection of the generated json file, it turns our to be basically empty:
{
"generatedAt": 1718716192115,
"generateTime": 20,
"contents": [

],
"navigation": [

]
}
{
"generatedAt": 1718716192115,
"generateTime": 20,
"contents": [

],
"navigation": [

]
}
What is this prerendering doing, is it necessairly? If not, can it be disabled?
1 replies
NNuxt
Created by Mole on 7/26/2023 in #❓・help
Can nuxt 3 middleware be asynchronous?
I am trying the below trivial example with one await and navigateTo, resulting in error:
[nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function.
[nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function.
const to = await getRouteTo()
return navigateTo(to)
const to = await getRouteTo()
return navigateTo(to)
2 replies
NNuxt
Created by Mole on 6/21/2023 in #❓・help
VSCode: How to "go to component" for auto-imports?
Alt + click on component takes me to components.d.ts. Is there a way to go to the .vue file directly?
6 replies
NNuxt
Created by Mole on 3/28/2023 in #❓・help
How to debug missing `vue/server-renderer` in bundle?
I am seeing the below error when requesting any path on production (debian):
[nuxt] [request error] [unhandled] [500] Cannot find module '/<redacted>/.output/server/node_modules/vue/server-renderer/index.mjs' imported from /<redacted>/.output/server/chunks/handlers/renderer.mjs
[nuxt] [request error] [unhandled] [500] Cannot find module '/<redacted>/.output/server/node_modules/vue/server-renderer/index.mjs' imported from /<redacted>/.output/server/chunks/handlers/renderer.mjs
The vue/server-renderer is not being properly included in bundled output. This reproduces steadily on the one server and I am yet to reproduce anywhere else. Major dependency that may cause the issue is nuxt-seo-kit. I am not asking to debug the issue for me, rather for an idea why server-renderer may be missing. Question is: How to debug missing vue/server-renderer in bundle?
8 replies
NNuxt
Created by Mole on 3/17/2023 in #❓・help
`_payload.js` cache with `nuxi generate`
Hey! Is there a way to bust cache of _payload.js when using static generation approach? I am using @nuxt/content@2.5.2 and nuxt@3.3.1. When updating content and regenerating website (nuxi generate) the server-served HTML is properly using new content, but it instantly gets replaced by outdated _payload.js. The website is served with nginx behind cloudflare. Both are configured with the most basic settings (no nginx cache, cloudflare default free plan). Is it possible to bust cache in similar fashion we do with other .js files, by adding a hash either to the filename, or as query parameter?
1 replies