Skip to content

Conversation

onlywei
Copy link
Contributor

@onlywei onlywei commented Oct 8, 2025

Hopefully fixes #5398 part 2

@schiller-manuel thanks for merging #5408. I've now tested the new version, and now I have encountered the next issue:

packages/start-plugin-core/src/start-compiler-plugin/plugin.ts also contains this snippet of code:

...resolveRuntimeFiles({
  package: `@tanstack/${framework}-start-client`,
  files: ['index.js'],
}),

I believe this is supposed to be either react-start-client or solid-start-client. Without declaring the dependency, we run into the error:

Error: Cannot find module '@tanstack/react-start-client/package.json'

Whichever one is needed must also be declared in dependencies, and it seems like incorrect design to me to add both to dependencies. I think the best way to handle this is using peerDependencies with peerDependenciesMeta to declare them as optional. This way since react-start and solid-start already declare both start-plugin-core and their respect -start-client packages as dependencies, theoretically this should cleanly resolve the issue.

Do you have an opinion on this? c.c. @tannerlinsley

Summary by CodeRabbit

  • New Features

    • None
  • Bug Fixes

    • None
  • Refactor

    • Streamlined build transformation by removing framework-specific client runtime resolution.
    • Fewer runtime files are excluded from inlining, improving build predictability and reducing unnecessary processing.
    • No changes to public APIs or user-facing behavior.

Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

Walkthrough

Adds two workspace-scoped peerDependencies to packages/start-plugin-core/package.json and marks them optional via peerDependenciesMeta. No runtime code or control flow changed.

Changes

Cohort / File(s) Summary
Package metadata updates
packages/start-plugin-core/package.json
Added peerDependencies entries: @tanstack/react-start-client: workspace:*, @tanstack/solid-start-client: workspace:*. Added peerDependenciesMeta entries marking both packages as "optional": true.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I twitch my whiskers, hop with glee,
Two peers now snug inside the tree.
Marked optional, linked by name,
In workspace burrows, all the same.
🐇 Build-hops onward—quiet, tame.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The changes introduce peerDependencies entries for @tanstack/react-start-client and @tanstack/solid-start-client along with peerDependenciesMeta marking them as optional, directly addressing the resolution errors outlined in issue [#5398] by declaring the necessary packages for runtime file lookups in workspace environments. This satisfies the linked issue’s requirement to ensure that framework-specific start-client packages can be resolved without forcing them as hard dependencies. By enabling optional peer resolution, the pull request aligns with the objective of fixing module/package resolution failures in pnpm/npm monorepos.
Out of Scope Changes Check ✅ Passed All modifications are confined to the peerDependencies and peerDependenciesMeta fields in packages/start-plugin-core/package.json and directly relate to the resolution error fix described in the linked issue. There are no other code or configuration changes affecting unrelated areas of the codebase. This update does not introduce any out-of-scope alterations beyond the intended dependency declarations.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly conveys the primary change by indicating that framework-specific start-client packages are no longer required by the start-plugin‐core, which matches the update to mark those dependencies as optional. It is concise, specific to the main change, and avoids unnecessary detail.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

nx-cloud bot commented Oct 8, 2025

View your CI Pipeline Execution ↗ for commit 0ff49af

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 4m 28s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 16s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-09 23:58:43 UTC

Copy link

pkg-pr-new bot commented Oct 8, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 0ff49af

@onlywei onlywei changed the title fix(start-plugin-core): Add optionalDependencies fix(start-plugin-core): use optional peerDependencies for "-start-client" packages Oct 9, 2025
@schiller-manuel
Copy link
Contributor

i think we should just remove this

...resolveRuntimeFiles({
  package: `@tanstack/${framework}-start-client`,
  files: ['index.js'],
}),

@onlywei
Copy link
Contributor Author

onlywei commented Oct 9, 2025

i think we should just remove this

...resolveRuntimeFiles({

  package: `@tanstack/${framework}-start-client`,

  files: ['index.js'],

}),

Is it not needed?

@schiller-manuel
Copy link
Contributor

it was an optimization to compile less (unnecessarily), but since we restructured exports etc. this is not doing anything anymore

@onlywei onlywei changed the title fix(start-plugin-core): use optional peerDependencies for "-start-client" packages fix(start-plugin-core): Remove framework specific packages from being required Oct 9, 2025
@onlywei
Copy link
Contributor Author

onlywei commented Oct 9, 2025

it was an optimization to compile less (unnecessarily), but since we restructured exports etc. this is not doing anything anymore

Alright. PR is now updated.

@schiller-manuel schiller-manuel merged commit d3cbb23 into TanStack:main Oct 10, 2025
6 checks passed
@onlywei
Copy link
Contributor Author

onlywei commented Oct 11, 2025

@schiller-manuel Sweet. I've tested the new release (v1.132.52) and it's working now in my monorepo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot use Tanstack Start inside of npm/pnpm workspaces

2 participants