fix: use package alias for h3 #5281
main fromrefs/pull/5281/head·merged 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
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-server-core
View your CI Pipeline Execution ↗ for commit c9f393ce15c2938b2a9c90132cf10f3cfd076beb
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 4m 34s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 20s View ↗
☁️ Nx Cloud last updated this comment at
2025-09-28 18:53:08UTCActionable 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.yamlis 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
h3ash3-v2breaks every existingimport "h3"call.Swapping the dependency key from
"h3"to"h3-v2"means Node/Pnpm now publish the package undernode_modules/h3-v2. All our code still doesimport {...} from "h3", so resolution will fail at runtime/build. If the goal is to pin tonpm: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
h3imports 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
h3import:
🏁 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.tscorrectly imports from'h3-v2' - ✅ No remaining broken imports - the one
'h3'reference found is inpackages/nitro-v2-vite-plugin/src/index.tsline 100, but that's:- A different package entirely
- A virtual entry string that generates code for nitropack's context (which has its own h3 dependency via nitropack)
- Not affected by the alias change in start-server-core
Your PR properly aliases
h3to 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!
More templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-static
@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@5281commit:
c9f393cschiller-manuel(GitHub profile, opens in a new tab)replied on
packages/start-server-core/package.jsonline 71well 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
coderabbitai[bot](GitHub profile, opens in a new tab)replied on
packages/start-server-core/package.jsonline 71🧩 Analysis chain
@schiller-manuel You're absolutely right - let me check the actual codebase for any remaining
h3imports 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
h3import:
🏁 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.tscorrectly imports from'h3-v2' - ✅ No remaining broken imports - the one
'h3'reference found is inpackages/nitro-v2-vite-plugin/src/index.tsline 100, but that's:- A different package entirely
- A virtual entry string that generates code for nitropack's context (which has its own h3 dependency via nitropack)
- Not affected by the alias change in start-server-core
Your PR properly aliases
h3to 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.
Walkthrough#
Replaced direct dependency and imports from
h3with an aliased packageh3-v2(pointing tonpm:h3@2.0.0-beta.4) in the package manifest and updated source import; no API/export changes.Changes#
packages/start-server-core/package.jsonh3with aliasedh3-v2targetingnpm:h3@2.0.0-beta.4.packages/start-server-core/src/request-response.ts'h3'to'h3-v2'for session/request utilities; no other code changes.Estimated code review effort#
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem#
Pre-merge checks and finishing touches#
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 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.yamlis 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)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/start-server-core/src/request-response.tspackages/{*-start,start-*}/**
📄 CodeRabbit inference engine (AGENTS.md)
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)
🔇 Additional comments (1)
Comment `@coderabbitai help` to get the list of available commands and usage tips.