-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SSR in plugin-vue-jsx #1939
Comments
I think I will try my hand at a PR for this tomorrow. Would love to contribute to such an awesome project |
Started a PR but I haven't made much progress. https://github.com/seanaye/vite/tree/seanaye/fix/supportSsrJsx/packages/plugin-vue-jsx |
Fixed in 30e92a1 - but thanks for your interest in working on a PR! |
@yyx990803 Thanks Evan! This works great for imported components but it doesn't work for App or page level components. Please see repro https://github.com/seanaye/vue3-tsx-tailwind. |
Should be addressed in 7a6aa2a Note Vue 3's JSX transform has issues with SSR when using text nodes - e.g.
to work around it. |
The latest I have updated all the text nodes to use template literals, but this appears to be unrelated.
Thanks very much for your support on this @yyx990803 |
Oh yeah this relies on a new Vite core release |
@yyx990803 I think it's getting very close. Using with the latest vite core gives following error. Maybe this is a vue-router issue now and not a vite one?
|
Describe the bug
Vite is unable to SSR when using jsx/tsx style Vue components. I have been told by a Vue maintainer this is is because
@vite/plugin-vue-jsx
is failing to inject modules into ssr context. Please see original issue for more contextReproduction
Please provide a link to a repo that can reproduce the problem you ran into.
https://github.com/seanaye/vue3-tsx-tailwind
yarn
yarn dev
Cannot read property forEach of undefined
I previously assumed this error came from
renderToString
from@vue/server-renderer
, see line 16 ofentry-server.ts
. Apparently this comes from the jsx plugin not injecting modules into ssr context.System Info
vite
version: 2.0.0 beta 65The text was updated successfully, but these errors were encountered: