-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
-
Environment
[email protected]@libp2p/[email protected](hoisted)- TypeScript via
tsc --project config/tsconfig.json - Node project depending on both Helia and
kubo-rpc-client
-
Steps to Reproduce
- Install Helia (
[email protected]) alongside[email protected]. - Import
PeerInfofrom the hoisted@libp2p/interface(e.g. insrc/helia/util.ts). - Call
helia.libp2p.contentRouting.findProviders, which yieldsPeerInfofromkubo-rpc-client/dist/.... - Run
tsc.
- Install Helia (
-
Actual Behavior
TypeScript raises:error TS2345: Argument of type 'import(".../node_modules/kubo-rpc-client/node_modules/@libp2p/interface/dist/src/peer-info").PeerInfo' is not assignable to parameter of type 'import(".../node_modules/@libp2p/interface/dist/src/peer-info").PeerInfo'. Types of property 'multiaddrs' are incompatible.The published declaration points at
kubo-rpc-client/node_modules/@libp2p/interface, so TypeScript treats it as a different module identity even though the package versions match. Runningnpm dedupeor otherwise flattening dependencies doesn’t change the emitted import path inside the.d.ts. -
Expected Behavior
The generated declarations should importPeerInfo(andMultiaddr) from the public package path (@libp2p/interface/@multiformats/multiaddr) so consumers get a single type identity. -
Suggested Fixes / Notes
- Move
@libp2p/interface(and@multiformats/multiaddr) to peer dependencies so only one copy is installed. - Alternatively, ensure the build emits type imports from the top-level package path instead of the nested
node_moduleslocation.
- Move
Metadata
Metadata
Assignees
Labels
No labels