Skip to content

fix(pacer-devtools): remove inline style objects to fix setStyleProperty export error#169

Open
restareaByWeezy wants to merge 1 commit intoTanStack:mainfrom
restareaByWeezy:fix-issue-131
Open

fix(pacer-devtools): remove inline style objects to fix setStyleProperty export error#169
restareaByWeezy wants to merge 1 commit intoTanStack:mainfrom
restareaByWeezy:fix-issue-131

Conversation

@restareaByWeezy
Copy link
Copy Markdown

Fixes #131

When using @tanstack/react-pacer-devtools in a Next.js application, the following error occurs during SSR:

Export setStyleProperty doesn't exist in target module
import { ..., setStyleProperty, ... } from "solid-js/web"

The root cause is that the Solid.js compiler transforms JSX inline style objects (style={{ ... }}) into setStyleProperty() calls. This function is exported from solid-js/web's browser build (web.js), but not from its server build (server.js). Since Next.js resolves solid-js/web using the server condition during SSR bundling, the function cannot be found.

To fix this, all inline style objects in the pacer-devtools components have been replaced with goober CSS classes, which is already the established pattern in this codebase. The one dynamic value (left panel width) is handled via a string-based style attribute, which the Solid compiler compiles to setAttribute rather than setStyleProperty.

Changes:

  • packages/pacer-devtools/src/styles/use-styles.ts: added min-width and max-width to the leftPanel class, added new stateHeaderRow and reductionValue classes
  • packages/pacer-devtools/src/components/Shell.tsx: replaced style object with string attribute for dynamic width, removed redundant flex: 1 (already present in rightPanel class)
  • packages/pacer-devtools/src/components/StateHeader.tsx: replaced two inline style objects with goober CSS classes

There are no visual or behavioral changes. The fix can be verified by checking that setStyleProperty no longer appears in the build output after this change.

grep -r "setStyleProperty" packages/pacer-devtools/dist/
# should return no results

…eProperty dependency

Solid.js compiler transforms `style={{ ... }}` object props into
`setStyleProperty()` calls from solid-js/web. This function only exists
in the browser build (web.js) but not the server build (server.js).
Next.js resolves solid-js/web using the server condition during SSR,
causing "Export setStyleProperty doesn't exist in target module" error.

Fix: replace all inline style objects with goober CSS classes, and use
string-based style attribute for the dynamic width value. This prevents
the Solid compiler from emitting setStyleProperty calls entirely.

Closes TanStack#131

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 9, 2026

⚠️ No Changeset found

Latest commit: 6cc0ff1

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

@KevinVandy
Copy link
Copy Markdown
Member

I'm wondering if it's more appropriate for the devtools to be expected to be client side only rendering

@restareaByWeezy
Copy link
Copy Markdown
Author

@KevinVandy Thanks for the feedback! I checked the react-pacer-devtools entry point and 'use client' is actually already declared on line 1 of src/index.ts. So even with that directive in place, the error was still happening.

The root cause turned out to be that the Solid.js compiler transforms inline style objects like style={{ flex: 1 }} into setStyleProperty() calls at build time, and those calls end up as explicit imports from solid-js/web in the compiled output. The server build of solid-js/web (which Next.js resolves during SSR bundling) simply doesn't export setStyleProperty, so the error occurs before any component even tries to render.

This fix removes all inline style objects from the components and replaces them with goober CSS classes, which is already the pattern used throughout the rest of the devtools codebase. That way the compiler never emits setStyleProperty calls in the first place.

@KevinVandy
Copy link
Copy Markdown
Member

"use client" does not mean "client only". It only means server and client. So that has nothing to do with it.

What I was meaning was that most meta frameworks export a <ClientOnly> component wrapper or something like that.

That being said, other tanstack maintainers have recommended that we make this change too like here: #181

So we will probably ship this or that pr

@restareaByWeezy
Copy link
Copy Markdown
Author

@KevinVandy Thanks for the correction — I appreciate you explaining the distinction between 'use client' and client-only rendering, that's a good point I hadn't considered properly.

I took a look at #181 and it addresses the same issue with a similar approach. Totally fine to close this one if that PR gets merged first — just happy to see this getting fixed either way!

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.

with devtools added getting export setStyleProperty was not found in module error

2 participants