Skip to content

bug: trpc server cannot be properly bundled with tsc + tsdown #6814

@Zombobot1

Description

@Zombobot1

Provide environment information

System:
OS: macOS 15.5
CPU: (12) arm64 Apple M4 Pro
Memory: 125.41 MB / 24.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.15.0 - ~/.local/state/fnm_multishells/47420_1749297684278/bin/node
Yarn: 1.22.22 - ~/.local/state/fnm_multishells/47420_1749297684278/bin/yarn
npm: 10.7.0 - ~/.local/state/fnm_multishells/47420_1749297684278/bin/npm
pnpm: 10.2.0 - ~/.local/state/fnm_multishells/47420_1749297684278/bin/pnpm
bun: 1.2.2 - ~/.bun/bin/bun
Browsers:
Chrome: 137.0.7151.69
Safari: 18.5
npmPackages:
@trpc/server: ^11.3.1 => 11.3.1
typescript: ^5.8.0 => 5.8.3

Describe the bug

I need to bundle my library that has a trpc router. I use tsc + tsdown.

It doesn't bundle types from "@trpc/server" and imports from them instead.

import * as _trpc_server_unstable_core_do_not_import0 from "@trpc/server/unstable-core-do-not-import";
import * as _trpc_server1 from "@trpc/server";

Link to reproduction

https://github.com/Zombobot1/tsdown-trcp-repro

To reproduce

open index.d.ts
or

pnpm i 
pnpm dev
open index.d.ts

Additional information

tsdown authors suspect issues with the current trpc implementation

rolldown/tsdown#303 (comment)

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR fixing this bug!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions