Describe the bug
In Solid 2.0.0-beta.14, client dynamic() supports Promise component sources through async-aware computation, and the public server dynamic() type also accepts Promise<T>.
However, server dynamic() renders nothing when the source returns a Promise, even when using the async SSR API.
This creates a server/client/API mismatch for async component sources. It is not a Solid 1.x regression; the issue is that the Solid 2 API appears to allow this shape, but the server path silently renders empty output.
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-tsjnp9k3?file=src%2Fentry-server.tsx
Steps to Reproduce the Bug or Issue
- Open the StackBlitz terminal.
- Run
npm run repro.
- Inspect the rendered string.
Expected behavior
Server dynamic() should either support Promise component sources in a way that matches the client, or produce an explicit unsupported diagnostic/error.
Because this repro uses renderToStringAsync, the server can wait for the Promise source.
If Promise sources are supported on the server, expected output shape:
Screenshots or Videos
No response
Platform
- OS: macOS
- Runtime: Node.js
- Version: current
next at d8921ac1
Additional context
This appears related to packages/solid-web/server/index.ts: server dynamic() reads the source synchronously and handles only function/string values:
const comp = source(),
t = typeof comp;
if (comp) {
if (t === "function") return comp(props);
else if (t === "string") return ssrElement(comp, props, undefined, true);
}
When source() returns a Promise, typeof comp is "object", so the server returns undefined instead of suspending/waiting or producing an explicit unsupported diagnostic.
Describe the bug
In Solid 2.0.0-beta.14, client
dynamic()supports Promise component sources through async-aware computation, and the public serverdynamic()type also acceptsPromise<T>.However, server
dynamic()renders nothing when the source returns a Promise, even when using the async SSR API.This creates a server/client/API mismatch for async component sources. It is not a Solid 1.x regression; the issue is that the Solid 2 API appears to allow this shape, but the server path silently renders empty output.
Your Example Website or App
https://stackblitz.com/edit/solidjs-templates-tsjnp9k3?file=src%2Fentry-server.tsx
Steps to Reproduce the Bug or Issue
npm run repro.Expected behavior
Server
dynamic()should either support Promise component sources in a way that matches the client, or produce an explicit unsupported diagnostic/error.Because this repro uses
renderToStringAsync, the server can wait for the Promise source.If Promise sources are supported on the server, expected output shape:
Screenshots or Videos
No response
Platform
nextatd8921ac1Additional context
This appears related to
packages/solid-web/server/index.ts: serverdynamic()reads the source synchronously and handles only function/string values:When
source()returns a Promise,typeof compis"object", so the server returnsundefinedinstead of suspending/waiting or producing an explicit unsupported diagnostic.