Repository navigation
Fix @astrojs/solid-js prerender crash with Solid ecosystem packages (e.g. @kobalte/core) - #17584
Merged
Merged
Conversation
Solid packages that ship pre-compiled browser artifacts via the `exports.solid` condition (e.g. @kobalte/core) were left external during prerendering, causing Node to resolve them via the `default` condition and crash with "Client-only API called on the server side." Use `crawlFrameworkPkgs` from `vitefu` to discover packages with a `solid-js` peer dependency and add them to `resolve.noExternal` for non-client environments, matching the approach used by @astrojs/svelte. Fixes #17583
1 task done
🦋 Changeset detectedLatest commit: 8a486ea The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
| 📦 Package | 📏 Size |
|---|---|
| @kobalte/core@0.13.12 | 3.7 MB |
| @swc/helpers@0.5.23 | 282.3 kB |
| @internationalized/number@3.6.7 | 237.4 kB |
| @kobalte/utils@0.9.2 | 235.4 kB |
| @floating-ui/core@1.8.0 | 218.6 kB |
| @floating-ui/dom@1.8.0 | 174.2 kB |
| @corvu/utils@0.4.2 | 84.5 kB |
| @floating-ui/utils@0.2.12 | 66.1 kB |
| @solid-primitives/utils@6.4.1 | 50.6 kB |
| @solid-primitives/event-listener@2.4.6 | 35.4 kB |
| @solid-primitives/rootless@1.5.4 | 24.1 kB |
| @solid-primitives/keyed@1.5.3 | 23.9 kB |
| @solid-primitives/props@3.2.4 | 21.9 kB |
| @solid-primitives/refs@1.1.4 | 19.8 kB |
| @solid-primitives/media@2.3.6 | 19.2 kB |
| solid-prevent-scroll@0.1.11 | 18.7 kB |
| @solid-primitives/map@0.4.13 | 17.8 kB |
| @solid-primitives/resize-observer@2.2.0 | 17.4 kB |
| @solid-primitives/static-store@0.1.4 | 14.3 kB |
| @solid-primitives/trigger@1.2.4 | 10.6 kB |
| solid-presence@0.1.8 | 10 kB |
Total size change: 5.2 MB
matthewp
approved these changes
Aug 3, 2026
matthewp
left a comment
Contributor
There was a problem hiding this comment.
Wow this is actually a pretty smart solution.
Merged
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.
Changes
exports.solidcondition (e.g.@kobalte/core) were left external during prerendering. Node resolved them via thedefaultcondition instead, which picks up browser-only code that callstemplate()and other APIs stubbed withnotSup()insolid-js/web/dist/server.js— crashingastro buildwith "Client-only API called on the server side".crawlFrameworkPkgsfromvitefuto discover all packages that declaresolid-jsas a peer dependency, then adds them toresolve.noExternalfor non-client environments (e.g.prerender). This forces Vite to bundle those packages so it can apply thesolidexport condition correctly, matching the established pattern from@astrojs/svelte(PR Fix .svelte files in node_modules with Cloudflare prerenderEnvironment: node #16210).vitefuto@astrojs/solid-js'sdependencies(previously it was only available as a transitive dep via other packages).Testing
No automated test added —
configEnvironmentPluginis internal and the solid integration has no existing test infrastructure for this; the svelte integration's equivalent fix also lacks a unit test. Fix was confirmed working by the reporter against both a minimal reproduction and a production project (12 pages).Docs
No docs update needed — this restores expected build behavior with no API changes.
Closes #17583