v-bind in SSR with dev server fails to resolve imported objects #11273
Labels
has workaround
A workaround has been found to avoid the problem
🐞 bug
Something isn't working
🔩 p2-edge-case
Vue version
3.4.31
Link to minimal reproduction
Steps to reproduce
When rendering SSR inside of the vite dev server with
vite.ssrLoadModule
,v-bind
inside of<style>
fails when referencing animport
-ed object from<script setup>
. Simply assigning the object to a newconst
at the script scope works around the issue, as does doing a production SSR build.App.vue:
ssr-fail.js:
What is expected?
What is actually happening?
System Info
System: OS: macOS 14.4.1 CPU: (10) arm64 Apple M1 Pro Memory: 1.50 GB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 21.7.2 - /opt/homebrew/bin/node npm: 10.8.1 - /opt/homebrew/bin/npm Browsers: Chrome: 126.0.6478.127 Safari: 17.4.1 Safari Technology Preview: 18.0 npmPackages: vue: ^3.4.29 => 3.4.31
Any additional comments?
We maintain a design-system module with various constants for color tokens. The most natural way to use these in our app components leads to this error in our dev environment.
The text was updated successfully, but these errors were encountered: