fix(svelte-devtools): add .js extension to ./types imports #565
main fromrefs/pull/565/head·merged by AlemTuzlak View on GitHub🎯 Changes#
svelte-package keeps the extensionless ./types specifier, so under moduleResolution: "NodeNext" or "Node16" the published declarations can't resolve it. With skipLibCheck: false that's a TS2835. With skipLibCheck: true the component props and plugin types silently become any. This adds .js to the three imports.
Checked with the repro from the issue: svelte-check now reports the expected errors in both modes.
Fixes #564
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested code changes locally with
pnpm test:pr, or these tests do not apply to this pull request. - I fully understand the code in this pull request, including any code generated with AI assistance.
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
Summary by CodeRabbit#
- Bug Fixes
- Fixed TypeScript type resolution for Svelte DevTools when using Node16 or NodeNext module resolution, preventing reported import errors and types from falling back to
any.
- Fixed TypeScript type resolution for Svelte DevTools when using Node16 or NodeNext module resolution, preventing reported import errors and types from falling back to
- 1
No actionable comments were generated in the recent review.
Walkthrough
-
The Svelte devtools package now uses explicit
.jsextensions for three relative type imports. A patch changeset records the update and the reported Node16 and NodeNext declaration-resolution issue.Changes: Svelte devtools type import resolution
Layer / File(s) Summary Update type import specifiers
packages/svelte-devtools/src/index.ts,packages/svelte-devtools/src/TanStackDevtools.svelte,packages/svelte-devtools/src/devtools.ts,.changeset/svelte-devtools-types-js-extension.mdThe type re-export and imports from ./typesnow specify./types.js. A patch changeset records the update.Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
alemtuzlak
Merge Risk:
Minimal · up to0e8da-
This change adds explicit file extensions to type imports so consumers using Node16 or NodeNext module resolution get correct types instead of errors or
any. The risk is very low and it is ready to merge.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the change: adding a .js extension to ./types imports in the svelte-devtools package. The changeset covers three imports in index.ts, TanStackDevtools.svelte, and devtools.ts, and the … Description check The description follows the repository template. It has a Changes section that states the problem (extensionless ./types specifier under NodeNext/Node16, TS2835 with skipLibCheck false, silent any wit… Linked Issues check Issue #564requires explicit.jsextensions on the relative./typesimports in the three source files named by the issue, so that the emitted declarations resolve under NodeNext and Node16. At the…Out of Scope Changes check The PR summary lists only the changeset (+5/-0) and one-line import changes (+1/-1) in each of the three source files. Each change is the .jsextension addition that issue#564requests, and the cha…Full details: Title check
-
Explanation
The title names the change: adding a .js extension to ./types imports in the svelte-devtools package. The changeset covers three imports in index.ts, TanStackDevtools.svelte, and devtools.ts, and the title matches that scope. It is a fix with a scoped conventional prefix.
Full details: Description check
-
Explanation
The description follows the repository template. It has a Changes section that states the problem (extensionless ./types specifier under NodeNext/Node16, TS2835 with skipLibCheck false, silent any with skipLibCheck true) and the fix (adding .js to three imports). It links issue
#564and reports verification with the issue repro. All three checklist sections are filled in. The release impact section marks the changeset as generated, which matches the changeset file in the summary.
Full details: Linked Issues check
-
Explanation
Issue
#564requires explicit.jsextensions on the relative./typesimports in the three source files named by the issue, so that the emitted declarations resolve under NodeNext and Node16. At the reviewed head (0e8da64), all three files use./types.js:packages/svelte-devtools/src/index.ts(export type { ... } from './types.js'),packages/svelte-devtools/src/TanStackDevtools.svelte(import type { TanStackDevtoolsSvelteInit } from './types.js'), andpackages/svelte-devtools/src/devtools.ts(import type { ... } from './types.js'). This matches the change the issue requests. The PR also adds a patch changeset for@tanstack/svelte-devtools, which the published-code release impact requires. The issue's acceptance outcome (no TS2835 with skipLibCheck false, and retained prop and plugin types with skipLibCheck true) follows from this change, since the emitted declarations carry the same specifiers. The PR author reports running the repro with svelte-check. I did not execute the repro. The base content was not read directly because the diff tool reported changed blobs as unavailable. The before-state is taken from the issue text and the PR summary. No automated test was added. The issue does not require one, and the PR checklist states that the repro was used.
Full details: Out of Scope Changes check
-
Explanation
The PR summary lists only the changeset (+5/-0) and one-line import changes (+1/-1) in each of the three source files. Each change is the
.jsextension addition that issue#564requests, and the changeset documents that change for the published package. No unrelated source, configuration, or test changes appear in the supplied evidence. The file-level reads at head confirm the three import changes and show no other edits in those files. The whole-PR diff tool was unavailable, so the absence of other changed files rests on the PR summary rather than a full diff read.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: TanStack/devtools
- Branch: main
- File: .coderabbit.yaml
- Commit: 8f62544
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c2a461d9-f745-42d9-98fa-c996f9c0b94c
Commits-
Reviewing files that changed from the base of the PR and between 8f625443bfde9c5ec6415f05958020aecb252d8d and 0e8da6490a99907b4bf57f7fbb1fad82b721dd28.
Files selected for processing: 4-
.changeset/svelte-devtools-types-js-extension.mdpackages/svelte-devtools/src/TanStackDevtools.sveltepackages/svelte-devtools/src/devtools.tspackages/svelte-devtools/src/index.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
-
dirgaydtm(GitHub profile, opens in a new tab) linked this to fix #564
tanstack-source added labelsbug
AlemTuzlak approved these changes
View your CI Pipeline Execution ↗ for commit 0e8da6490a99907b4bf57f7fbb1fad82b721dd28
Command Status Duration Result nx run-many --targets=build --exclude=examples/...✅ Succeeded 4s View ↗ 💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗
☁️ Nx Cloud last updated this comment at
2026-11-19 12:18:38UTCMore templates
- @tanstack/devtools-example-angular-a11y-devtools
- @tanstack/devtools-example-angular-basic
- @tanstack/devtools-example-angular-panel
- ssr
- @tanstack/devtools-example-angular-with-devtools
- @tanstack/devtools-example-preact-basic
- @tanstack/devtools-custom-devtools-preact
- @tanstack/react-devtools-a11y-example
- @tanstack/devtools-example-react-basic
- start-repro
- @tanstack/devtools-custom-devtools
- tanstack-start-example-counter
- @tanstack/devtools-example-react-https
- start
- start-cloudflare
- start-nitro
- @tanstack/devtools-example-react-time-travel
- @tanstack/solid-devtools-a11y-example
- @tanstack/devtools-example-solid-basic
- @tanstack/devtools-example-devtools-ui
- @tanstack/devtools-example-solid-start
- @tanstack/query-example-vue-basic
@tanstack/angular-devtools
npm i https://pkg.pr.new/@tanstack/angular-devtools@565@tanstack/devtools
npm i https://pkg.pr.new/@tanstack/devtools@565@tanstack/devtools-a11y
npm i https://pkg.pr.new/@tanstack/devtools-a11y@565@tanstack/devtools-bundler-core
npm i https://pkg.pr.new/@tanstack/devtools-bundler-core@565@tanstack/devtools-client
npm i https://pkg.pr.new/@tanstack/devtools-client@565@tanstack/devtools-rspack
npm i https://pkg.pr.new/@tanstack/devtools-rspack@565@tanstack/devtools-ui
npm i https://pkg.pr.new/@tanstack/devtools-ui@565@tanstack/devtools-utils
npm i https://pkg.pr.new/@tanstack/devtools-utils@565@tanstack/devtools-vite
npm i https://pkg.pr.new/@tanstack/devtools-vite@565@tanstack/devtools-webmcp
npm i https://pkg.pr.new/@tanstack/devtools-webmcp@565@tanstack/devtools-event-bus
npm i https://pkg.pr.new/@tanstack/devtools-event-bus@565@tanstack/devtools-event-client
npm i https://pkg.pr.new/@tanstack/devtools-event-client@565@tanstack/preact-devtools
npm i https://pkg.pr.new/@tanstack/preact-devtools@565@tanstack/react-devtools
npm i https://pkg.pr.new/@tanstack/react-devtools@565@tanstack/solid-devtools
npm i https://pkg.pr.new/@tanstack/solid-devtools@565@tanstack/svelte-devtools
npm i https://pkg.pr.new/@tanstack/svelte-devtools@565@tanstack/vue-devtools
npm i https://pkg.pr.new/@tanstack/vue-devtools@565commit:
0e8da64AlemTuzlak merged this8cd7dc1
AlemTuzlak closed this
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 0e8da6490a99907b4bf57f7fbb1fad82b721dd28
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