-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: @trpc/server@next also installing Next.js (regression in 11.0.0-rc.630) #6254
Comments
It looks like trpc/packages/server/package.json Line 157 in 5c3057a
Looking at https://docs.npmjs.com/cli/v9/configuring-npm/package-json#optionaldependencies, they're going to get installed by default unless the user explicitly opts out of installing them. I imagine instead these should be peer dependencies, with the peer dependency meta obj marking them as optional? I think that might behave better? |
Thanks. It's an easy fix, will fix tmrw unless @trpc/trpc-core beats me to it |
Optional peerDependencies is a myth that I don't think any package manager honors... better to just remove them i think |
Both the pnpm and npm docs explicitly call out peerDependenciesMeta and setting a package as optional, so I would think it is honored? |
yea they're supposed to - and in the simple cases they do but i have multiple monorepos where they're complaining about peer deps that's caused by optional peer deps being pulled in where they shouldn't |
here you have an example of it breaking (it seems like it might be fixed in upcomning pnpm 10): {
"name": "pnpm",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"ai": "^3",
"typescript": "^5.6.3"
},
"packageManager": "pnpm@9.6.0"
} where the yet they are installed: |
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you. |
Provide environment information
Describe the bug
Hey! 👋
Apologies if I missed an existing issue for this.
It looks like
@trpc/server
is now installing Next.js as a dependency.Looks like this was a regression introducred in
11.0.0-rc.630
based on my testing. Installing11.0.0-rc.621
locally doesn't bring in Next, but as soon as I install11.0.0-rc.630
it starts pulling in Next.This is significantly bloating any installs because I don't use Next.js with tRPC (especially on the server), and it's a 20MB (+40MB for SWC) install that's being pulled in with
@trpc/server
.Link to reproduction
https://stackblitz.com/edit/node-6i9dpd?file=index.js
Note: just run
pnpm install
and then look innode_modules/.pnpm
and you'll see that Next and React DOM has been installed (when only@trpc/server@11.0.0-rc.630
was installed).To reproduce
@trpc/server@11.0.0-rc.621
@trpc/server@11.0.0-rc.630
Additional information
No response
👨👧👦 Contributing
Funding
The text was updated successfully, but these errors were encountered: