js-deprecated icon indicating copy to clipboard operation
js-deprecated copied to clipboard

buffer-layout typescript issue

Open etodanik opened this issue 4 years ago • 8 comments

We have an issue with one of our upstream dependencies:

node_modules/@solana/spl-token/lib/index.d.ts(3,24): error TS7016: Could not find a declaration file for module 'buffer-layout'. '/Users/danny/src/metaplexql/node_modules/buffer-layout/lib/Layout.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/buffer-layout` if it exists or add a new declaration (.d.ts) file containing `declare module 'buffer-layout';

It appears that @solana/spl-token depends on this package, and it currently has no TypeScript support: https://github.com/pabigot/buffer-layout/issues/30

etodanik avatar Sep 28 '21 12:09 etodanik

@israelidanny can you open an issue on the SPL repo to migrate from buffer-layout to @solana/buffer-layout which has type definitions? That should resolve this issue once fixed.

jstarry avatar Oct 19 '21 15:10 jstarry

Done @jstarry https://github.com/solana-labs/solana-program-library/issues/2534

If they take too long I'll submit a PR too

etodanik avatar Oct 20 '21 14:10 etodanik

looks like a partial fix landed upstream https://github.com/solana-labs/solana-program-library/pull/2629. Please confirm @israelidanny if we are good to go now or not.

aheckmann avatar Dec 11 '21 00:12 aheckmann

I added a more complete fix but it has a couple of caveats (and a pull request in @solana/buffer-layout that needs merging) https://github.com/solana-labs/solana-program-library/pull/2634

etodanik avatar Dec 13 '21 15:12 etodanik

The relevant PR in @solana/buffer-layout has been merged and the package released. No rush from my end, just letting you know!

jordaaash avatar Dec 15 '21 02:12 jordaaash

@jordansexton I updated my branch to include the new @solana/buffer-layout and removed code made redundant by the new utils package!

etodanik avatar Dec 16 '21 19:12 etodanik

Update: the upstream changes are still in progress in https://github.com/solana-labs/solana-program-library/pull/2634

aheckmann avatar Jan 25 '22 20:01 aheckmann

https://github.com/solana-labs/solana-program-library/pull/2634 has been merged. Thank you for your patience! Which NPM packages are you blocked on here?

jordaaash avatar Mar 27 '22 04:03 jordaaash