pinia tries to import default export from vue package #2570
Replies: 1 comment
-
@posva Can you tell me in which version this behavior was fixed, and whether it was a vite or pinia issue? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions