Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/fix-solid-js-type-leak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@tanstack/query-devtools": patch
---

Fix solid-js types leaking into bundled .d.ts file

Remove `experimentalDts: true` and `delete tsup_option.dts` from tsup.config.ts to prevent solid-js internal types from being exposed to React projects. Reverts to rollup-plugin-dts which correctly treats solid-js as external.

Fixes #10421
Comment on lines +7 to +9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if solid-query-devtools build output contains similar type leakage issues

# Check if solid-query-devtools has the same tsup config pattern
echo "=== Checking solid-query-devtools tsup.config.ts ==="
cat packages/solid-query-devtools/tsup.config.ts

# Check the current build output for type imports (if build exists)
echo -e "\n=== Checking for solid-js imports in solid-query-devtools build output ==="
if [ -f packages/solid-query-devtools/build/index.d.ts ]; then
  rg -n "from ['\"]solid-js|from ['\"]@solid-primitives" packages/solid-query-devtools/build/index.d.ts || echo "No solid-js imports found in build output"
else
  echo "Build output does not exist. Run 'pnpm build' in solid-query-devtools to verify."
fi

# Compare with query-devtools tsup config to see the difference
echo -e "\n=== Comparing with query-devtools tsup.config.ts ==="
cat packages/query-devtools/tsup.config.ts

Repository: TanStack/query

Length of output: 1384


Consider applying the same fix to solid-query-devtools.

The changeset correctly documents the fix for @tanstack/query-devtools. However, packages/solid-query-devtools/tsup.config.ts (lines 19-20) contains the identical problematic pattern (experimentalDts: true and delete tsup_option.dts). Since the issue (#10421) is about dts bundling causing type leakage, solid-query-devtools is susceptible to the same problem and should receive the same fix. Either include it in this PR or open a separate issue to track it.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.changeset/fix-solid-js-type-leak.md around lines 7 - 9, The same dts
leakage fix needs applying to packages/solid-query-devtools: open
packages/solid-query-devtools/tsup.config.ts and remove the experimentalDts:
true setting and the delete tsup_option.dts statement so tsup does not bundle
d.ts for solid-js; instead ensure the build uses rollup-plugin-dts (or the
existing rollup dts path) which treats solid-js as external—mirror the exact
change made for `@tanstack/query-devtools` by deleting the experimentalDts flag
and the tsup_option.dts deletion so types are not emitted/bundled into the
package.

2 changes: 0 additions & 2 deletions packages/query-devtools/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export default defineConfig(() => {

tsup_options.forEach((tsup_option) => {
tsup_option.outDir = 'build'
tsup_option.experimentalDts = true
delete tsup_option.dts
})

return tsup_options
Expand Down
Loading