Repository navigation
Conversation
…build) Fixes vercel-labs#375. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@nprbst is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
nprbst
marked this pull request as ready for review
October 19, 2026 21:18
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #375.
Problem
@json-render/solidis compiled only with Solid's DOM output (generate: "dom"). The DOM output hoists every native-element JSX template to module scope (var _tmpl$ = template(...)), e.g. the markup inConfirmDialog. Under thenode,workeranddenoconditions,solid-js/webresolves to its server runtime, wheretemplatethrows "Client-only API called on the server side" and other DOM-only helpers (such assetStyleProperty) are not exported. So the package throws as soon as it is imported on the server, before any component renders:Bun fails the same way.
Fix
Ship a second build compiled with Solid's SSR output, and select it with the same export conditions
solid-js/webuses, so this package always runs against the runtimesolid-js/webresolves to:tsup.config.ts: keep the existing DOM build (index,schema, with types) and add an SSR build ofsrc/index.tsasdist/index.server.{mjs,js}. Both builds have the same exports.package.json: the"."export gainsworker,browser,denoandnodeconditions (mirroringsolid-js/web). Browser bundlers and jsdom tests keep getting the DOM build; Node, Bun, Vite SSR and edge workers get the SSR build.types,main/moduleand./schemaare unchanged.buildbecomesrm -rf dist && tsup, as inpackages/next, since the two configs no longer share aclean.The SSR build is non-hydratable, matching the existing DOM build; hydration is out of scope here.
Tests
packages/solid/src/ssr.test.tsruns the built package in a plain Node child process, because Vitest here resolves with thebrowsercondition and cannot exercise the server path:requireunder Node's default conditions does not throw;renderToStringfromsolid-js/webrenders a spec throughJSONUIProviderandRenderer.All three fail on
mainwith the errors above and pass with this change.@types/nodeis added to the package's devDependencies so the test type-checks.pnpm turbo run build --filter='./packages/*': 30/30pnpm test: 82 files, 1236 tests passedpnpm type-check: 61/61pnpm lint: 14/14🤖 Generated with Claude Code