Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

compiler rc.18: SSR template validation rejects SVG <image> outside an <svg>-rooted template

Cerrado
#4,241 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
53/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, typescript
Área
backend, web-dev

Línea de trabajo

The report identifies SSR template validation as the failing path but names no source or test files. Start by comparing how DOM and SSR validation establish SVG context, then reproduce with the four supplied cases using transform with generate: 'ssr' and validate: true. Done means all four compile for SSR as they do for DOM, with the validation tests covering SVG roots, fragments, control flow, and nested SVG context.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the bug

@solidjs/[email protected] (#4238, "validate SSR templates for malformed HTML") rejects an SVG <image> in an SSR template unless the template itself is rooted at <svg>. The DOM compile of the same source passes, so the SSR validator does not apply the SVG context the DOM validator does: it parses <image> as HTML, where the parser turns it into <img>.

This breaks any SSR'd component that puts an <image> under control flow (<Show>, <For>), in a fragment, or under a <g> template root, even when it is inside an <svg> in the parent template.

Reproduction
const { transform } = require('@solidjs/compiler') // 2.0.0-rc.18
const cases = {
  showInSvg: "import {Show} from 'solid-js'; export const A = (p) => <svg><Show when={p.on}><image href='a.png' /></Show></svg>",
  gRoot: "export const B = () => <g><image href='a.png' /></g>",
  fragment: "export const C = () => <><clipPath id='c'><circle r={1} /></clipPath><image href='a.png' /></>",
  svgRoot: "export const D = () => <svg><image href='a.png' /></svg>",
}
for (const [name, code] of Object.entries(cases))
  for (const generate of ['dom', 'ssr'])
    try { transform(code, { filename: 'x.tsx', generate, hydratable: true, validate: true }); console.log(name, generate, 'ok') }
    catch (e) { console.log(name, generate, 'ERR', String(e.message).split('\n')[0]) }

Output:

showInSvg dom ok
showInSvg ssr ERR The HTML provided is malformed and will yield unexpected output when evaluated by a browser. (1:79)
gRoot dom ok      / gRoot ssr ERR ...
fragment dom ok   / fragment ssr ERR ...
svgRoot dom ok    / svgRoot ssr ok
User HTML:    <image></image>
Browser HTML: <img>
Expected

The SSR validator treats a template as SVG under the same rules as the DOM validator (an SVG element name at the template root, or a template inside an <svg> element's subtree), so the four cases compile for ssr exactly as they do for dom.

Environment

solid-js / @solidjs/web / @solidjs/compiler 2.0.0-rc.18, @solidjs/vite-plugin 3.0.0-next.51. Found while qualifying rc.18 for celados/glaze (its SSR gate renders a block whose crest is an SVG <image> under <Show>).

Lenguaje dominante
TypeScript
Estrellas
36.2k
Forks
1.1k
Merge medio
11 h 5 min
PR fusionados (30 d)
353

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de solidjs/solid

Todos los issues de solidjs/solid

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.