cosmos / cosmjs

The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.
https://cosmos.github.io/cosmjs/
Apache License 2.0
647 stars 332 forks source link

@cosmjs/proto-signing compile error #1549

Open chris-ricketts opened 8 months ago

chris-ricketts commented 8 months ago

Getting the following error when compiling a project:

node_modules/@cosmjs/proto-signing/build/registry.d.ts:4:13 - error TS1192: Module '"<redacted>/node_modules/protobufjs/index"' has no default export.

4 import type protobuf from "protobufjs";
              ~~~~~~~~

Found 1 error in node_modules/@cosmjs/proto-signing/build/registry.d.ts:4

If I patch node_modules/@cosmjs/proto-signing/build/registry.d.ts:4 to the following it compiles without error:

import * as protobuf from "protobufjs";
"devDependencies": {
    "typescript": "^5.3.3",
    ...
 },
"dependencies": {
    "@cosmjs/cosmwasm-stargate": "^0.32.2",
    "@cosmjs/encoding": "^0.32.2",
    "@cosmjs/proto-signing": "^0.32.2",
    "@cosmjs/stargate": "^0.32.2",
    ...
 }

Node Version: v20.11.0