Skip to content

fix(devtools): prevent solid-js from leaking into server bundles#367

Open
AlemTuzlak wants to merge 1 commit intomainfrom
worktree-zany-yawning-quill
Open

fix(devtools): prevent solid-js from leaking into server bundles#367
AlemTuzlak wants to merge 1 commit intomainfrom
worktree-zany-yawning-quill

Conversation

@AlemTuzlak
Copy link
Collaborator

Summary

  • Moved all solid-js runtime imports (render, Portal, lazy, ClientEventBus) from core.tsx into a new mount-impl.tsx file
  • core.ts now uses import('./mount-impl') inside mount() so solid-js is never in the static import graph
  • Server/client entry points (server.js, index.js, dev.js) are now completely free of solid-js references — solid code only loads as a separate chunk when mount() is called on the client

Problem

When using @tanstack/react-devtools (or any non-Solid adapter) in SSR environments like Cloudflare workerd, solid-js code leaked into the server bundle through the static import graph of @tanstack/devtools, causing runtime crashes.

Test Plan

  • All 77 nx tasks pass (test:lib, test:types, test:eslint, test:knip, test:sherif, test:build, build)
  • dist/server.js and dist/index.js contain zero solid-js references
  • examples/react/bundling-repro builds successfully with zero solid-js in the server bundle

Move all solid-js runtime imports (render, Portal, lazy, ClientEventBus)
from core into a new mount-impl.tsx file loaded via dynamic import().
This ensures solid-js code is never in the static import graph and only
loads as a separate chunk when mount() is called on the client.
@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 07753f3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Mar 4, 2026

View your CI Pipeline Execution ↗ for commit 07753f3

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 1m 7s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 11s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-04 18:56:56 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

More templates

@tanstack/devtools

npm i https://pkg.pr.new/@tanstack/devtools@367

@tanstack/devtools-client

npm i https://pkg.pr.new/@tanstack/devtools-client@367

@tanstack/devtools-ui

npm i https://pkg.pr.new/@tanstack/devtools-ui@367

@tanstack/devtools-utils

npm i https://pkg.pr.new/@tanstack/devtools-utils@367

@tanstack/devtools-vite

npm i https://pkg.pr.new/@tanstack/devtools-vite@367

@tanstack/devtools-event-bus

npm i https://pkg.pr.new/@tanstack/devtools-event-bus@367

@tanstack/devtools-event-client

npm i https://pkg.pr.new/@tanstack/devtools-event-client@367

@tanstack/preact-devtools

npm i https://pkg.pr.new/@tanstack/preact-devtools@367

@tanstack/react-devtools

npm i https://pkg.pr.new/@tanstack/react-devtools@367

@tanstack/solid-devtools

npm i https://pkg.pr.new/@tanstack/solid-devtools@367

@tanstack/vue-devtools

npm i https://pkg.pr.new/@tanstack/vue-devtools@367

commit: 5a6efbe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant