Vue/server-renderer tsx support
Version
3.0.5
Reproduction link
https://github.com/seanaye/vue3-tsx-tailwind
Steps to reproduce
- clone repro
- yarn
- yarn dev
- Open localhost:3000
Cannot read property 'forEach' of undefined
This is because ctx is not being populated via the renderToString
function from @vue/server-renderer
when using tsx files. (see line 16 in server-entry.ts
)
I have copied the files from the vite ssg example repo, but I am using .tsx vue files instead of standard vue SFC files.
What is expected?
App should render with vite SSR
What is actually happening?
The renderToString
function from @vue/server-renderer
is not populating the ctx object found on line 16 inside of server-entry.ts
I am 90% sure that vue server renderer is not recognizing the .tsx
files since I have tried changing the references to .vue
files and the app renders as expected.
You should submit the issue to Vite, @vite/plugin-vue
injects modules into ssr context by wrapping user setup, see https://github.com/vitejs/vite/blob/main/packages/plugin-vue/src/main.ts#L133. I think the @vite/plugin-vue-jsx
needs to do the same thing.