Repository navigation
Conversation
The toolbar runs in the page and cannot see the server process or the disk. In dev serve, when the app uses @solidjs/start-devtools: - errors the server runtime reports through configureServerErrors are sent to the toolbar over the HMR channel, and the app's own hook is still called - the toolbar's hello gets the installed versions and the errors kept since the page started loading - /__solid/devtools/open-in-editor resolves a location against the Vite root and hands it to Vite's /__open-in-editor The generated client entry and the mount module call connectDevServer with import.meta.hot when the devtools release exports it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d28ecb5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
lxsmnsyc
marked this pull request as ready for review
November 4, 2026 23:37
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.
The devtools toolbar runs in the page. It cannot see errors in the server process, where the Vite root is, or which packages are installed. This adds the dev server side of a channel that sends it those. The toolbar side is solidjs/solid-start-devtools#48.
Start mode only, during
vite dev, and only when the app uses@solidjs/start-devtools. Builds,vite previewand Vitest are left alone.What the toolbar gets
configureServerErrors: a render, a server function, a request. The toolbar lists them in its Health view.solid-js,@solidjs/web,@solidjs/vite-pluginandvite, read from the app root.GET /__solid/devtools/open-in-editor?file=src/App.tsx:12:5resolves the location against the Vite root and hands the absolute path to Vite's own/__open-in-editor. Leading folders are dropped until the file exists, soexamples/app/src/App.tsxstill opens when the root isexamples/app. A missing file answers 404. The toolbar used to send one request per sub-path because it did not know the root.How
connectDevServer(import.meta.hot). The toolbar is pre-bundled and has noimport.meta.hotof its own. The call uses a namespace import and atypeofcheck, so a devtools release withoutconnectDevServerkeeps working.solid:devtools:hellowithperformance.timeOrigin. The plugin answerssolid:devtools:infowith the versions and the errors it kept since then (up to 50). This is how the error of the render that served the page gets there, since that render happens before the page can connect. Later errors go out assolid:devtools:server-error.configureServerErrorskeeps one hook onglobalThis, so registering a second one would replace the app's. The plugin turns the slot'shookinto an accessor instead. The app's call sets the app hook, and the runtime reads a hook that reports the failure and then calls the app's. The accessor is put back when the dev server closes.Changes
src/devtools/server.ts: thesolid:devtools/serverplugin, the error accessor, version lookup and location resolving.src/devtools/protocol.ts: the event names, the endpoint and the payload types. They are copies of@solidjs/start-devtools/protocoluntil a devtools release ships it. Then the constants take that entry's types, assrc/diagnosticsdoes with@solidjs/diagnostics/protocol.src/devtools/index.ts:devtoolsConnectCode(), used by the mount module.src/ssr/index.ts: the generated client entry connects, and the start plugins includesolid:devtools/serverunlessstart.devtoolsisfalse.Testing
src/devtools/server.test.tsruns the accessor against the real@solidjs/webserver runtime. A failure reaches both the listener and the app's hook. With no app hook a failed request is still printed. The app's hook is restored on stop. It also covers location resolving, version lookup, package detection and the generated connect code.ssr: true, start: { devtools: true }) served with this build and the devtools branch of #48. Its component throws during the server render. The page got the info with the error and the versions, Health showedServer render: server render boom, and the endpoint answered 404 for a missing file. I did not call the endpoint with a file that exists, since that launches the editor.vitest run(138 tests),tsc --noEmit,pnpm build,pnpm checkandpnpm testpass locally.Risk
@solidjs/webkeeping the hook underSymbol.for("solid-js/server/errors")and readingslot.hookon each report. A listener API in@solidjs/webwould replace it.handling: "failed". I have not checked whether the runtime prints other kinds without a hook, so some console output may be lost while devtools is installed.globalThis, so its errors are not heard.Not done
sourceNames./@fs/.🤖 Generated with Claude Code