-
Notifications
You must be signed in to change notification settings - Fork 737
[Bug]: @rolldown/browser missing binding type declarations #8929
Description
Reproduction link or steps
Install @rolldown/browser in a TypeScript project with moduleResolution: "bundler" and run tsc --noEmit. The repro has the minimal setup and a CI workflow that shows the failure.
What is expected?
@rolldown/browser type declarations work with moduleResolution: "bundler" - same as the main rolldown package.
What is actually happening?
9 TS2307 errors. The .d.mts files in @rolldown/browser reference binding.cjs as an external module, but no corresponding type declaration file exists in the published package.
Cannot find module '../binding.cjs' or its corresponding type declarations.
Cannot find module '../../binding.cjs' or its corresponding type declarations.
Cannot find module './binding.cjs' or its corresponding type declarations.
The main rolldown package doesn't have this issue because its DTS output bundles the binding types inline into dist/shared/binding-[hash].d.mts. The browser package doesn't because resolveWasiBinding() in build.ts marks binding.cjs as external: 'relative' for all importers - including the .d.ts files generated by rolldown-plugin-dts. The dts resolver sees external: true and passes it through without bundling the types.
System Info
TypeScript: 5.9.3
@rolldown/browser: 1.0.0-rc.12
@types/node: 24.10.3
Node: 22
pnpm: 9Any additional comments?
Here is a proposed solution: #8930
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackPriority
Effort