metaplex-foundation / umi

A Solana Framework for JS Clients.
https://umi.typedoc.metaplex.com
MIT License
168 stars 51 forks source link

Add the types condition to the package.json#exports #83

Open richardpg2 opened 1 year ago

richardpg2 commented 1 year ago

Could not find a declaration file for module '@metaplex-foundation/umi-web3js-adapters'. './node_modules/.pnpm/@metaplex-foundation+umi-web3js-adapters@0.8.7_@metaplex-foundation+umi@0.8.7_@solana+web3.js@1.78.4/node_modules/@metaplex-foundation/umi-web3js-adapters/dist/esm/index.mjs' implicitly has an 'any' type. There are types at '/Volumes/Richard/Work/Research/stack/ReactJs/vite-app-testg/node_modules/@metaplex-foundation/umi-web3js-adapters/dist/types/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@metaplex-foundation/umi-web3js-adapters' library may need to update its package.json or typings.

Suggested solution: Correctly link the declaration files, as seen in https://github.com/gxmari007/vite-plugin-eslint/pull/60. Updating the package.json will make this package compatible with the new moduleResolution option.

https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing

lorisleiva commented 1 year ago

Hi there, sorry for the late reply. Is this what you had in mind? https://github.com/metaplex-foundation/umi/pull/86

lorisleiva commented 1 year ago

I've published a new patch update with that change. Let me know if that fixes your issue. 🙏