Skip to content

fix(svelte-devtools): add .js extension to ./types imports - #565

Open
dirgaydtm wants to merge 1 commit into
TanStack:mainfrom
dirgaydtm:fix-svelte-types-js-extension
Open

dirgaydtm wants to merge 1 commit into
TanStack:mainfrom
dirgaydtm:fix-svelte-types-js-extension

Conversation

@dirgaydtm

@dirgaydtm dirgaydtm commented Nov 17, 2026 •

Copy link
Copy Markdown

🎯 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.

svelte-package keeps relative import specifiers as written, so the published
declarations imported './types' without an extension. Under NodeNext or
Node16 resolution, TypeScript rejects that with TS2835 when skipLibCheck is
off. With skipLibCheck on, the import silently fails and the TanStackDevtools
props and the exported plugin types turn into any.

Fixes TanStack#564
@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0e8da64

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/svelte-devtools Patch

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

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Svelte devtools package now uses explicit .js extensions 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.md
The type re-export and imports from ./types now 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 to 0e8da

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Issue #564 requires explicit .js extensions on the relative ./types imports 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 Passed 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 .js extension addition that issue #564 requests, 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 #564 and 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 #564 requires explicit .js extensions on the relative ./types imports 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'), and packages/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 .js extension addition that issue #564 requests, 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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8f62544 and 0e8da64.

Files selected for processing: 4

  • .changeset/svelte-devtools-types-js-extension.md
  • packages/svelte-devtools/src/TanStackDevtools.svelte
  • packages/svelte-devtools/src/devtools.ts
  • packages/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.

This branch has not been deployed

No deployments
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.

@tanstack/svelte-devtools: published declarations omit .js extension on ./types imports, breaking node16/nodenext

1 participant