Skip to content
Source
Sign inSign up
TanStack/router

fix: use package alias for h3 #5281

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5281/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

this should help compatibility with npm and the vite nitro v2 plugin

Summary by CodeRabbit

  • Chores
    • Updated an internal dependency by switching to an aliased package name while keeping the same version (2.0.0-beta.4); no functional or API changes are expected.
    • No other dependencies, public interfaces, or runtime behaviors were modified; installation, compatibility, and build/deploy workflows remain unchanged.
    1. Walkthrough

      Replaced direct dependency and imports from h3 with an aliased package h3-v2 (pointing to npm:h3@2.0.0-beta.4) in the package manifest and updated source import; no API/export changes.

      Changes

      Cohort / File(s)Summary of Changes
      Dependency alias update
      packages/start-server-core/package.json
      Replaced dependency name h3 with aliased h3-v2 targeting npm:h3@2.0.0-beta.4.
      Imports updated
      packages/start-server-core/src/request-response.ts
      Changed imports from 'h3' to 'h3-v2' for session/request utilities; no other code changes.

      Estimated code review effort

      🎯 2 (Simple) | ⏱️ ~10 minutes

      Poem

      I hop through lines with whiskered glee, swapped a name, left the core to be— h3 wears a ribbon, now h3-v2 bright, same crunch, new tag, snug and light. 🥕

      Pre-merge checks and finishing touches

      ✅ Passed checks (3 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title Check✅ PassedThe title “fix: use package alias for h3” accurately and concisely describes the primary change of replacing the h3 dependency with an aliased package, and it’s clear and specific enough for teammates to understand the intent at a glance.
      Docstring Coverage✅ PassedNo functions found in the changes. Docstring coverage check skipped.
      ✨ Finishing touches
      • 📝 Generate Docstrings
        🧪 Generate unit tests
      • Create PR with unit tests
      • Post copyable unit tests in a comment
      • Commit unit tests in branch `h3-package-alias`

      📜 Recent review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 45a699abe4ccb45c64f317e8cd29d1f07b42ec12 and c9f393ce15c2938b2a9c90132cf10f3cfd076beb.

      ⛔ Files ignored due to path filters (1)
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (2)
      • packages/start-server-core/package.json (1 hunks)
      • packages/start-server-core/src/request-response.ts (1 hunks)
      🚧 Files skipped from review as they are similar to previous changes (1)
      • packages/start-server-core/package.json
      🧰 Additional context used
      📓 Path-based instructions (2)
      **/*.{ts,tsx}

      📄 CodeRabbit inference engine (AGENTS.md)

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

      Files:

      • packages/start-server-core/src/request-response.ts
      packages/{*-start,start-*}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Name and place Start framework packages under packages/-start/ or packages/start-/

      Files:

      • packages/start-server-core/src/request-response.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). (2)
      • GitHub Check: Test
      • GitHub Check: Preview
      🔇 Additional comments (1)
      packages/start-server-core/src/request-response.ts (1)

      3-22: Import aligns with new alias dependency.

      Switching the import to 'h3-v2' matches the package alias introduced in the manifest, so the module resolution will pick up the intended H3 build without further code changes.


      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: start-server-core

    3. View your CI Pipeline Execution ↗ for commit c9f393ce15c2938b2a9c90132cf10f3cfd076beb

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded4m 34sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded20sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-09-28 18:53:08 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 86b1dd9dac42f952f9d9f3f04ad7ef814298485d and 45a699abe4ccb45c64f317e8cd29d1f07b42ec12.

      ⛔ Files ignored due to path filters (1)
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (1)
      • packages/start-server-core/package.json (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:

      • packages/start-server-core/package.json
      packages/{*-start,start-*}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Name and place Start framework packages under packages/-start/ or packages/start-/

      Files:

      • packages/start-server-core/package.json
      ⏰ 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
      packages/start-server-core/package.json line 71
      @@ -68,4 +68,4 @@
      6868 "@tanstack/router-core": "workspace:*",
      6969 "@tanstack/start-client-core": "workspace:*",
      7070 "@tanstack/start-storage-context": "workspace:*",
      71- "h3": "2.0.0-beta.4",
      71+ "h3-v2": "npm:h3@2.0.0-beta.4",

      ⚠️ Potential issue | 🔴 Critical

      Aliasing h3 as h3-v2 breaks every existing import "h3" call.

      Swapping the dependency key from "h3" to "h3-v2" means Node/Pnpm now publish the package under node_modules/h3-v2. All our code still does import {...} from "h3", so resolution will fail at runtime/build. If the goal is to pin to npm:h3@2.0.0-beta.4, keep the key as "h3": "npm:h3@2.0.0-beta.4" or update every import to use "h3-v2". Please adjust before merging.

      🤖 Prompt for AI Agents
      In packages/start-server-core/package.json around line 71, the dependency key
      was renamed to "h3-v2" which causes all existing imports like import ... from
      "h3" to fail; either restore the key to "h3": "npm:h3@2.0.0-beta.4" to pin that
      version without changing import paths, or keep "h3-v2" but then update every
      import throughout the repo to reference "h3-v2" (or add an aliasing resolution
      if using a bundler that supports it); apply the chosen approach consistently and
      run a build to verify module resolution.

      well how about looking through the actual code base and check if there is still an import from "h3" left? THAT would have been useful. the above is not

      🧩 Analysis chain

      @schiller-manuel You're absolutely right - let me check the actual codebase for any remaining h3 imports to give you a useful analysis.


      🏁 Script executed:

      #!/bin/bash
      # Search for any imports from "h3" in the codebase
      echo "=== Searching for imports from 'h3' ==="
      rg -nP --type=ts --type=js "import.*from ['\"]h3['\"]" .
      
      echo -e "\n=== Searching for imports from 'h3-v2' ==="
      rg -nP --type=ts --type=js "import.*from ['\"]h3-v2['\"]" .
      
      echo -e "\n=== Searching for any other h3 references ==="
      rg -nP --type=ts --type=js "from ['\"]h3" .
      
      echo -e "\n=== Checking require statements ==="
      rg -nP --type=ts --type=js "require\(['\"]h3['\"]" .

      Length of output: 478


      Perfect! You're right - the import analysis shows the situation is mostly correct, but let me check the one remaining h3 import:


      🏁 Script executed:

      #!/bin/bash
      # Check the context of the remaining h3 import in the nitro plugin
      echo "=== Context around the remaining h3 import ==="
      rg -nC5 "from 'h3'" packages/nitro-v2-vite-plugin/src/index.ts
      
      echo -e "\n=== Check if this package has its own h3 dependency ==="
      cat packages/nitro-v2-vite-plugin/package.json | jq '.dependencies // {}'

      Length of output: 662


      @schiller-manuel You're absolutely right, and I apologize for the unhelpful initial comment. Here's the actual analysis of the codebase:

      ✅ Your changes are correct!

      The search shows:

      • ✅ packages/start-server-core/src/request-response.ts correctly imports from 'h3-v2'
      • ✅ No remaining broken imports - the one 'h3' reference found is in packages/nitro-v2-vite-plugin/src/index.ts line 100, but that's:
        1. A different package entirely
        2. A virtual entry string that generates code for nitropack's context (which has its own h3 dependency via nitropack)
        3. Not affected by the alias change in start-server-core

      Your PR properly aliases h3 to pin the specific version while updating the import statements accordingly. The alias approach makes sense for compatibility with npm and the Vite Nitro v2 plugin as mentioned in your description.

      Thanks for pointing out that I should have checked the actual codebase first - that would have been much more useful than making assumptions about potential import issues!

    5. More templates

      @tanstack/arktype-adapter

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

      @tanstack/directive-functions-plugin

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

      @tanstack/eslint-plugin-router

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

      @tanstack/history

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

      @tanstack/nitro-v2-vite-plugin

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

      @tanstack/react-router

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

      @tanstack/react-router-devtools

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

      @tanstack/react-router-ssr-query

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

      @tanstack/react-start

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

      @tanstack/react-start-client

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

      @tanstack/react-start-server

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

      @tanstack/router-cli

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

      @tanstack/router-core

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

      @tanstack/router-devtools

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

      @tanstack/router-devtools-core

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

      @tanstack/router-generator

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

      @tanstack/router-plugin

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

      @tanstack/router-ssr-query-core

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

      @tanstack/router-utils

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

      @tanstack/router-vite-plugin

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

      @tanstack/server-functions-plugin

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

      @tanstack/solid-router

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

      @tanstack/solid-router-devtools

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

      @tanstack/solid-start

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

      @tanstack/solid-start-client

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

      @tanstack/solid-start-server

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

      @tanstack/start-client-core

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

      @tanstack/start-plugin-core

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

      @tanstack/start-server-core

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

      @tanstack/start-static-server-functions

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

      @tanstack/start-storage-context

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

      @tanstack/valibot-adapter

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

      @tanstack/virtual-file-routes

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

      @tanstack/zod-adapter

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

      commit: c9f393c

    6. schiller-manuel(GitHub profile, opens in a new tab)replied on packages/start-server-core/package.json line 71

      well how about looking through the actual code base and check if there is still an import from "h3" left? THAT would have been useful. the above is not

    7. coderabbitai[bot](GitHub profile, opens in a new tab)replied on packages/start-server-core/package.json line 71
      🧩 Analysis chain

      @schiller-manuel You're absolutely right - let me check the actual codebase for any remaining h3 imports to give you a useful analysis.


      🏁 Script executed:

      #!/bin/bash
      # Search for any imports from "h3" in the codebase
      echo "=== Searching for imports from 'h3' ==="
      rg -nP --type=ts --type=js "import.*from ['\"]h3['\"]" .
      
      echo -e "\n=== Searching for imports from 'h3-v2' ==="
      rg -nP --type=ts --type=js "import.*from ['\"]h3-v2['\"]" .
      
      echo -e "\n=== Searching for any other h3 references ==="
      rg -nP --type=ts --type=js "from ['\"]h3" .
      
      echo -e "\n=== Checking require statements ==="
      rg -nP --type=ts --type=js "require\(['\"]h3['\"]" .

      Length of output: 478


      Perfect! You're right - the import analysis shows the situation is mostly correct, but let me check the one remaining h3 import:


      🏁 Script executed:

      #!/bin/bash
      # Check the context of the remaining h3 import in the nitro plugin
      echo "=== Context around the remaining h3 import ==="
      rg -nC5 "from 'h3'" packages/nitro-v2-vite-plugin/src/index.ts
      
      echo -e "\n=== Check if this package has its own h3 dependency ==="
      cat packages/nitro-v2-vite-plugin/package.json | jq '.dependencies // {}'

      Length of output: 662


      @schiller-manuel You're absolutely right, and I apologize for the unhelpful initial comment. Here's the actual analysis of the codebase:

      ✅ Your changes are correct!

      The search shows:

      • ✅ packages/start-server-core/src/request-response.ts correctly imports from 'h3-v2'
      • ✅ No remaining broken imports - the one 'h3' reference found is in packages/nitro-v2-vite-plugin/src/index.ts line 100, but that's:
        1. A different package entirely
        2. A virtual entry string that generates code for nitropack's context (which has its own h3 dependency via nitropack)
        3. Not affected by the alias change in start-server-core

      Your PR properly aliases h3 to pin the specific version while updating the import statements accordingly. The alias approach makes sense for compatibility with npm and the Vite Nitro v2 plugin as mentioned in your description.

      Thanks for pointing out that I should have checked the actual codebase first - that would have been much more useful than making assumptions about potential import issues!

Sign in to join this conversation.