dwol
How to prerender Nuxt Content when ssr is disabled?
The only way I’ve found to reliably do this is with setting ssr to true. You can still run generate with ssr: true. There’s also the experimental/ client build config option but it doesn’t seem very reliable for me.
3 replies
@nuxtjs/i18n test errors
You need to create an i18n plugin for your tests. I have a mocks/i18n.ts
import { createI18n } from 'vue-i18n'
import en from '~/locales/en-CA'
import fr from '~/locales/fr-CA'
export const enI18n = createI18n({
legacy: false,
locale: 'en-CA',
messages: {
'en-CA': en
}
})
export const frI18n = createI18n({
legacy: false,
locale: 'fr-CA',
messages: {
'fr-CA': fr
}
})
export const randomI18n = createI18n({
legacy: false,
locale: 'ja',
messages: {
ja: en
}
})
Then import your i18n mock and use in your component:
const wrapper = await mountSuspended(MyComponent, {
global: {
plugins: [enI18n]
}
})
19 replies
Not fetching Supabase data
You aren’t returning anything or using await
https://nuxt.com/docs/api/composables/use-async-data
20 replies
Nuxt Content Markdown gets only rendered with server side rendering
The only way I've reliably gotten this to work is by setting ssr true and generating it that way.
You can still generate the static site with ssr true.
The only thing with this that is annoying is you may have to deal with hydration errors.
2 replies