Skip to content

Support SSR in plugin-vue-jsx  #1939

Closed
Closed
@seanaye

Description

@seanaye

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 context

Reproduction

Please provide a link to a repo that can reproduce the problem you ran into.

https://github.com/seanaye/vue3-tsx-tailwind

  1. clone
  2. yarn
  3. yarn dev
  4. open localhost:3000

Cannot read property forEach of undefined

I previously assumed this error came from renderToString from @vue/server-renderer, see line 16 of entry-server.ts. Apparently this comes from the jsx plugin not injecting modules into ssr context.

System Info

  • vite version: 2.0.0 beta 65
  • Operating System: Mac OS Big Sur M1 Chip
  • Node version: 15.3.0
  • Package manager (npm/yarn/pnpm) and version: yarn 1.22.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions