Skip to content
Source
Sign inSign up
TanStack/devtools

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

Mergeddirgaydtm(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/565/headmerged 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.
    1. 🦋 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
      NameType
      @tanstack/svelte-devtoolsPatch

      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

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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 nameStatusExplanation
      Title checkPassedThe 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 checkPassedThe 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 checkPassedIssue #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 checkPassedThe 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 8f625443bfde9c5ec6415f05958020aecb252d8d and 0e8da6490a99907b4bf57f7fbb1fad82b721dd28.

      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.

    3. tanstack-source added labelsbug

    4. tanstack-sourceBotcommented Only here. This is not on GitHub.

      Ready to merge: every factory step passed on 0e8da64.

      • audit: clean

      TanStack Source bot

    5. AlemTuzlak approved these changes

    6. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 0e8da6490a99907b4bf57f7fbb1fad82b721dd28

      CommandStatusDurationResult
      nx run-many --targets=build --exclude=examples/...✅ Succeeded4sView ↗

      💡 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:38 UTC

    7. More templates

      @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@565

      commit: 0e8da64

    8. AlemTuzlak merged this8cd7dc1

    9. AlemTuzlak closed this

    10. 🎉 This PR has been released!

      Thank you for your contribution!

Sign in to join this conversation.