sui icon indicating copy to clipboard operation
sui copied to clipboard

typescript SDK not work with ESM project using multiple exports

Open zfy0701 opened this issue 2 years ago • 1 comments

Steps to Reproduce Issue

create ESM ts project, change the following

    "module": "esnext",
    "moduleResolution": "nodenext",

the last line is ask compiler to use this https://github.com/MystenLabs/sui/blob/main/sdk/typescript/package.json#L18-L24

but this missing information so the compiler will fail with:

Could not find a declaration file for module '@mysten/sui.js'. '/xxxx/node_modules/@mysten/sui.js/dist/index.mjs' implicitly has an 'any' type.

Expected Result

the code should compile

please see this for the correct fix: https://github.com/MystenLabs/sui/pull/8200/files#diff-1097377c78d22400c9189626a6f2d209142a89cc652ea050fb577aa1087634e0R23

Actual Result

compile failed

System Information

  • OS: os x
  • Compiler: node 16

zfy0701 avatar Feb 19 '23 18:02 zfy0701

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 21 '23 01:04 github-actions[bot]