fix: nuxtServerInit not working with nuxt-vite
mirabledictu opened this issue · 3 comments
mirabledictu commented
Hi, it looks like nuxtServerInit
ain't working when nuxt-vite
and nuxt-typed-vuex
are both in buildModules
.
Here's a simple reproduction https://github.com/mirabledictu/test-vuex-vite
I have a simple console log there
export const actions = {
nuxtServerInit(_context) {
// This will not log if nuxt-typed-vuex is added to buildModules
console.log('works')
}
}
and in my nuxt.config.js
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
'nuxt-vite',
'nuxt-typed-vuex',
],
vite: {
ssr: true
}
}
When you try to run it, you will not get any logs from server.
Try to remove nuxt-vite
or nuxt-typed-vuex
in buildModules
and it will work.
danielroe commented
How odd. Note that there are known issues with ssr in nuxt-vite
.
mirabledictu commented
How odd. Note that there are known issues with ssr in
nuxt-vite
.
Noted on that
hotrungnhan commented
not only ssr mode ,but also csr mode . Not work with vite, do you have any plan to fix this isuee