Following the docs' request to file an issue when the native backend differs from expectations (compiler option docs).
Versions
vite-plugin-solid 3.0.0-next.13 (default compiler: 'native')
@dom-expressions/compiler 0.50.0-next.23
solid-js / @solidjs/web 2.0.0-beta.20
Repro
import { Show } from 'solid-js'
export function ClientOnly(props) {
return (
<Show when={props.when} fallback={props.fallback ?? null}>
<>{props.children}</>
</Show>
)
}
With generate: 'dom' this fails at transform time:
Error: GenericFailure, Only text and expression component children are implemented in the AST-native milestone
The same source compiles fine with compiler: 'babel', and also with the native compiler in generate: 'ssr' mode — so dom and ssr builds of the same file currently disagree.
Characterization
Direct @dom-expressions/compiler transform() calls with { generate, hydratable: true, moduleName: '@solidjs/web' }:
| pattern |
dom |
ssr |
<Show><>{expr}</></Show> (fragment child, expression inside) |
❌ |
✅ |
<Show><>text</></Show> (fragment child, text inside) |
❌ |
✅ |
<Show><><div/></></Show> (fragment child, element inside) |
❌ |
✅ |
<Show><div/></Show> (element child) |
✅ |
✅ |
<Show>{expr}</Show> (expression child) |
✅ |
✅ |
<><div/></> (root fragment) |
✅ |
✅ |
(<div><>…</></div> fails in both modes, but that looks intentional — ssr mode reports the classic "Fragments can only be used top level in JSX", so it's excluded from the report.)
Context
Hit while upgrading TanStack Router to beta.20 / next.13 (TanStack/router#7850). A whole-repo scan (~1350 solid .tsx/.jsx files) found the fragment-as-component-child pattern only once, so in our case the fix was simply dropping a redundant <>…</> wrapper — but the pattern is valid under babel and presumably common in the wild, and since next.13 makes native the default, existing code hits this as a hard transform error on upgrade.
Following the docs' request to file an issue when the native backend differs from expectations (
compileroption docs).Versions
vite-plugin-solid3.0.0-next.13 (defaultcompiler: 'native')@dom-expressions/compiler0.50.0-next.23solid-js/@solidjs/web2.0.0-beta.20Repro
With
generate: 'dom'this fails at transform time:The same source compiles fine with
compiler: 'babel', and also with the native compiler ingenerate: 'ssr'mode — so dom and ssr builds of the same file currently disagree.Characterization
Direct
@dom-expressions/compilertransform()calls with{ generate, hydratable: true, moduleName: '@solidjs/web' }:<Show><>{expr}</></Show>(fragment child, expression inside)<Show><>text</></Show>(fragment child, text inside)<Show><><div/></></Show>(fragment child, element inside)<Show><div/></Show>(element child)<Show>{expr}</Show>(expression child)<><div/></>(root fragment)(
<div><>…</></div>fails in both modes, but that looks intentional — ssr mode reports the classic "Fragments can only be used top level in JSX", so it's excluded from the report.)Context
Hit while upgrading TanStack Router to beta.20 / next.13 (TanStack/router#7850). A whole-repo scan (~1350 solid
.tsx/.jsxfiles) found the fragment-as-component-child pattern only once, so in our case the fix was simply dropping a redundant<>…</>wrapper — but the pattern is valid under babel and presumably common in the wild, and since next.13 makes native the default, existing code hits this as a hard transform error on upgrade.