linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Preact & Vite Server Side rendering throws error

Open functionalDev opened this issue 1 year ago • 0 comments

Environment

  • Linaria version: 6.1.0
  • @wyw-in-js/vite: 0.5.0,
  • preact: 10.19.3,
  • preact-render-to-string: 6.3.1
  • Vite: 5.1.3
  • Node.js version: 20.3
  • express: 4.18.2
  • OS: Windows 10

Description

When server side rendering linaria component with renderToString from "preact-render-to-string" an error is thrown

Error: [object Object] is not a valid HTML tag name in <[object Object]> at T (file:///C:/ROAD/webapp/node_modules/preact-render-to-string/dist/index.mjs:1:7405)

Reproducible Demo

A minimal demo with an express server: https://codesandbox.io/p/devbox/linaria-preact-vite-6g9frp

When running npm run start or the "start SSR"-task you will see the error thrown in the terminal/console.

functionalDev avatar Mar 12 '24 13:03 functionalDev