Skip to content
Source
Sign inSign up
TanStack/router

fix(router-devtools-core): actually bundle solid #5422

Mergedbenmccann(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/5422/headmerged by birkskyum(GitHub profile, opens in a new tab)

closes https://github.com/TanStack/router/issues/5420

I'm not sure why upgrading @tanstack/config causes the build to fail. I could use some help with that as it seems a bit unrelated. I believe this fix should work once we get past that

Summary by CodeRabbit

  • Chores
    • Build configuration updated to bundle an additional UI library for more reliable builds across environments.
    • Development tooling dependency upgraded to a newer version for improved build compatibility and maintenance.
    • Linting configuration cleaned up to remove an unnecessary directive, simplifying developer tooling.
    1. Important

      Review skipped

      Review was skipped due to path filters

      :no_entry: Files ignored due to path filters (1)
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

      CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Walkthrough

      Adds bundling of solid-js and solid-js/web by passing bundledDeps: ['solid-js', 'solid-js/web'] into the tanstack Vite config for router-devtools-core, bumps devDependency @tanstack/config from ^0.16.1 to ^0.21.0, and removes a // @ts-expect-error comment above an import in eslint.config.js. No exported API changes.

      Changes

      Cohort / File(s)Summary of changes
      Vite config change
      packages/router-devtools-core/vite.config.ts
      Adds bundledDeps: ['solid-js', 'solid-js/web'] to the merged call to tanstackViteConfig, instructing the build to bundle solid-js and solid-js/web.
      Dependency bump
      package.json
      Updates devDependency @tanstack/config from ^0.16.1 to ^0.21.0.
      ESLint config cleanup
      eslint.config.js
      Removes the // @ts-expect-error directive above the import of tanstackConfig from @tanstack/config/eslint; import remains unchanged.

      Sequence Diagram(s)

      sequenceDiagram
          autonumber
          participant Dev as Developer/CI
          participant tanstack as tanstackViteConfig
          participant Vite as Vite/Rollup
      
          Dev->>tanstack: build using merged config (bundledDeps: ["solid-js","solid-js/web"])
          tanstack->>Vite: emit Vite config with bundledDeps
          Vite->>Vite: bundle listed deps into output (no externalize)
          Vite-->>Dev: produced build artifacts (solid-js imports resolved)

      Estimated code review effort

      🎯 3 (Moderate) | ⏱️ ~20 minutes

      Suggested reviewers

      • brenelz

      Poem

      I hop through lines with a whiskered cheer, Bundling two solids so builds run clear. No missing imports, no frantic cry, Carrots and config — watch builds fly! 🥕🐇

      Pre-merge checks and finishing touches

      ❌ Failed checks (1 warning)
      Check nameStatusExplanationResolution
      Out of Scope Changes Check⚠️ WarningThis pull request includes a bump of the @tanstack/config devDependency and the removal of a TypeScript expect-error directive in eslint.config.js, neither of which are needed to resolve the unresolved import of solid-js/web described in issue #5420 and thus fall outside the scope of that issue’s objectives.Consider splitting the @tanstack/config upgrade and ESLint directive removal into a separate pull request or clearly document how they relate to the linked issue to keep the scope focused.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title Check✅ PassedThe title concisely and accurately describes the primary change of bundling Solid in the router-devtools-core package, aligning with the modifications in the Vite configuration without extra noise or missing the core fix.
      Linked Issues Check✅ PassedThe pull request adds solid-js and solid-js/web to the bundledDeps in the Vite configuration, ensuring these modules are included in the build output and resolving the Rollup unresolved import error without requiring users to install solid-js, directly fulfilling the objectives of issue #5420.
      Docstring Coverage✅ PassedNo functions found in the changes. Docstring coverage check skipped.

      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
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-devtools-core

    3. View your CI Pipeline Execution ↗ for commit 5f4e2fcf75aa23f4ba82e237b370464cb784209f

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded1m 10sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-10-14 15:02:57 UTC

    4. Actionable comments posted: 1

      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 30970808c5e472d8b91f058f6c382cc129e1b380 and 8809a2bf7aed0592ece6dff15b4df2d39e9c418c.

      📒 Files selected for processing (1)
      • packages/router-devtools-core/vite.config.ts (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (1)
      **/*.{ts,tsx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use TypeScript in strict mode with extensive type safety across the codebase

      Files:

      • packages/router-devtools-core/vite.config.ts
      🧠 Learnings (1)
      📓 Common learnings
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.598Z
      Learning: Applies to packages/router-plugin/** : Use unplugin for universal bundler plugins in the router-plugin package
      🔇 Additional comments (1)
      packages/router-devtools-core/vite.config.ts (1)

      18-19: Good practice documenting the temporary workaround.

      The TODO comment clearly communicates the intent to refactor this into a cleaner solution within @tanstack/config/vite. This aligns well with the PR description's stated follow-up plans.

      OutdatedResolvedby benmccann(GitHub profile, opens in a new tab)
    5. Actionable comments posted: 1

      🧹 Nitpick comments (1)
      packages/router-devtools-core/vite.config.ts (1)

      18-20: Temporary workaround acknowledged.

      The TODO comment appropriately documents the intent to refactor this via tanstackViteConfig. Given the urgency to unblock users, this interim approach is reasonable.

      Would you like me to open a tracking issue for the planned refactor to @tanstack/config/vite?

      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 30970808c5e472d8b91f058f6c382cc129e1b380 and 6049a0da27339a085e41915974e4bf7b9dc2066e.

      📒 Files selected for processing (1)
      • packages/router-devtools-core/vite.config.ts (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (1)
      **/*.{ts,tsx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use TypeScript in strict mode with extensive type safety across the codebase

      Files:

      • packages/router-devtools-core/vite.config.ts
      OutdatedResolvedby benmccann(GitHub profile, opens in a new tab)
    6. More templates

      @tanstack/arktype-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5422

      @tanstack/directive-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5422

      @tanstack/eslint-plugin-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5422

      @tanstack/history

      npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5422

      @tanstack/nitro-v2-vite-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5422

      @tanstack/react-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5422

      @tanstack/react-router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5422

      @tanstack/react-router-ssr-query

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5422

      @tanstack/react-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5422

      @tanstack/react-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5422

      @tanstack/react-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5422

      @tanstack/router-cli

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5422

      @tanstack/router-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5422

      @tanstack/router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5422

      @tanstack/router-devtools-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5422

      @tanstack/router-generator

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5422

      @tanstack/router-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5422

      @tanstack/router-ssr-query-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5422

      @tanstack/router-utils

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5422

      @tanstack/router-vite-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5422

      @tanstack/server-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5422

      @tanstack/solid-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5422

      @tanstack/solid-router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5422

      @tanstack/solid-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5422

      @tanstack/solid-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5422

      @tanstack/solid-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5422

      @tanstack/start-client-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5422

      @tanstack/start-plugin-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5422

      @tanstack/start-server-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5422

      @tanstack/start-static-server-functions

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5422

      @tanstack/start-storage-context

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5422

      @tanstack/valibot-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5422

      @tanstack/virtual-file-routes

      npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5422

      @tanstack/zod-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5422

      commit: 5f4e2fc

    7. Actionable comments posted: 1

      🧹 Nitpick comments (1)
      packages/router-devtools-core/vite.config.ts (1)

      23-26: Consider handling non-function external types.

      Rollup's external option accepts string, RegExp, arrays, or functions. If tanstackViteConfig can ever set external to an array or regex, the early return will break that configuration. However, if this scenario is guaranteed never to occur (as suggested by the comment), the defensive check is acceptable.

      If you want to handle all external types robustly, apply this diff:

           if (typeof config?.build?.rollupOptions?.external !== 'function') {
      -      // this can never happen, but we need to make typescript happy
      -      return
      +      // If external is not a function, keep it as-is but still block solid-js
      +      const staticExternal = config.build.rollupOptions.external
      +      config.build.rollupOptions.external = (id: string) => {
      +        if (id === 'solid-js' || id.startsWith('solid-js/')) return false
      +        // staticExternal could be string, regex, or array - let Rollup handle it
      +        return undefined // Let Rollup apply staticExternal pattern
      +      }
      +      return config
           }

      Otherwise, verify with the maintainers that tanstackViteConfig always sets a function and this branch is truly unreachable.

      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 189b0df78e085f931c6333f1bdc003f1c2939858 and 7582b93a39865ad50c7283f36e04e743eb0a8a4a.

      📒 Files selected for processing (1)
      • packages/router-devtools-core/vite.config.ts (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (1)
      **/*.{ts,tsx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use TypeScript in strict mode with extensive type safety across the codebase

      Files:

      • packages/router-devtools-core/vite.config.ts
      ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
      • GitHub Check: Test
      OutdatedResolvedby benmccann(GitHub profile, opens in a new tab)
    8. Actionable comments posted: 1

      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 7582b93a39865ad50c7283f36e04e743eb0a8a4a and 186cfee77b9b015a9d723920071eeae91db666a0.

      ⛔ Files ignored due to path filters (1)
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (2)
      • package.json (1 hunks)
      • packages/router-devtools-core/vite.config.ts (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (2)
      **/package.json

      📄 CodeRabbit inference engine (AGENTS.md)

      Use workspace:* protocol for internal dependencies in package.json files

      Files:

      • package.json
      **/*.{ts,tsx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use TypeScript in strict mode with extensive type safety across the codebase

      Files:

      • packages/router-devtools-core/vite.config.ts
      ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
      • GitHub Check: Test
      🔇 Additional comments (1)
      package.json (1)

      41-41: @tanstack/config v0.21.0 upgrade is safe Confirmed support for bundledDeps, no security advisories, and no breaking changes impacting this usage.

      OutdatedResolvedby benmccann(GitHub profile, opens in a new tab)
    9. why do we need to upgrade config? what does this version do that we need?

    10. @schiller-manuel , I can see that the latest tanstack config has this change:

    11. The issues that show up in the CI here are indeed unrelated to the PR. The errors show when bumping tanstack/config from 0.16.1 to 0.17.0 or higher on the main branch. @lachlancollins , I can see 0.17.1 move to TypeScirpt, but it appear much stricter already from 0.17.0 - do you know how that can be?

    12. The issue was related to vite-plugin-dts, which I've temporarily fixed to v4.0.3.

Sign in to join this conversation.