Closed starlys closed 7 months ago
none
Using vue 3.4.15, vite 5.0.4, and pinia 2.1.7.
Vite config includes the following to internalize pinia and externalize vue. noExternal: true, external: { 'vue' ....}
Then build for SSR: npx vite -ssr ./output-path
The resulting SSR output will include a line like: import { ....} from 'vue';
The resulting SSR output include a line like: import $require0, { ....} from 'vue'; where the variable $require0 is used only in the pinia code.
The problem with this is that the vue package does not have a default export, so the SSR code does not run.
A workaround is to externalize pinia, but ideally pinia would not expect vue package to have a default export.
Reproduction
none
Steps to reproduce the bug
Using vue 3.4.15, vite 5.0.4, and pinia 2.1.7.
Vite config includes the following to internalize pinia and externalize vue. noExternal: true, external: { 'vue' ....}
Then build for SSR: npx vite -ssr ./output-path
Expected behavior
The resulting SSR output will include a line like: import { ....} from 'vue';
Actual behavior
The resulting SSR output include a line like: import $require0, { ....} from 'vue'; where the variable $require0 is used only in the pinia code.
The problem with this is that the vue package does not have a default export, so the SSR code does not run.
Additional information
A workaround is to externalize pinia, but ideally pinia would not expect vue package to have a default export.