#375

fix(solid): package import calls a client-only API on the server

Opencoygeekopened 1mo ago

Summary

Importing the released @json-render/solid package under Node's default server condition throws before the application can call a renderer or select any exports. A plain Solid server-rendering control succeeds in the same consumer.

Steps to reproduce

  1. In a fresh consumer, install @json-render/core@0.21.0, @json-render/solid@0.21.0, solid-js@1.9.15, and zod@4.3.6.
  2. Run the following control and package import as separate commands.
node --input-type=module -e 'import {renderToString} from "solid-js/web"; console.log(renderToString(() => "SSR control"))'
node --input-type=module -e 'import "@json-render/solid"'

Expected behavior

Importing the package in the Solid server runtime should not execute a client-only DOM API. The reduced closure signal is successful import under the default Node server condition; it does not require proving every renderer feature supports SSR.

Actual behavior

The control prints SSR control. The package import throws Client-only API called on the server side. Run client-only code in onMount, or conditionally run client-only component with <Show>. The released bundle calls the Solid template helper during module initialization, before any consumer component renders.

Affected area

The root entry point of @json-render/solid and its compiled bundle.

Runtime or environment

Reproduced with Node v22.23.2, npm 12.0.2, @json-render/core and @json-render/solid 0.21.0, solid-js 1.9.15, and zod 4.3.6. Current inspected main is fc2a696a50a30cb30c878ab1eb65e102487eea0f and npm reports 0.21.0 for the affected package.

Evidence

The Solid build configuration compiles its entry points with generate: "dom". A previous reduced consumer located the import-time trigger at @json-render/solid/dist/index.mjs:382; the fresh import-only probe reproduces the same client-only API message.

Impact

Server code cannot import the root package to use its exports, and an SSR consumer fails before it can render or install an application-level guard.

Activity

0

No activity yet.