-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web3.js: TypeError regression #16207
Comments
Thanks for the report @armaniferrante! I believe this is a symptom rather than an issue in itself. I think the root issue is that TypeScript is not picking up type definitions from It's unclear to me how TypeScript expects library maintainers to handle the transition from a non-TS library to TS one since they don't recommend adding module declarations if your source is written in TypeScript. I think a reasonable fix is to post-process the generated TypeScript type definitions to add back the module declaration for now, similar to what I had to do here for Flow types: https://github.com/solana-labs/solana/pull/16190/files#diff-f19c8c93d627f3d50bad9193e516cf8891677c9e7068a822f28125560adec32a |
@armaniferrante I'm working on a fix for this now |
@armaniferrante this should be fixed when the next release v1.2.3 is published |
I'm still getting the error, which happens at runtime. Some extra details (not sure if they're relevant):
|
Ok, I'll take a look tomorrow, thanks for the extra context @armaniferrante! |
The issue is that your code is passing a |
Sounds acceptable to me! I'll give it a shot. Thanks a bunch for investigating @jstarry. |
Works like a charm. Hopefully I'm not speaking too soon, but the fix was this line coral-xyz/anchor@6576e0d#diff-43fffbeff5b448207741b2bd0e9a4872347c17dcb5eb7cf655aedd1e519349a2R77. |
@armaniferrante after more thinking, this change technically breaks the interface by requiring pubkey inputs to have this new |
In order to get my build to work once more, I need to change this line https://github.com/solana-labs/solana/blob/master/web3.js/src/system-program.ts#L674 to be
programId: params.programId.toBuffer()
. Otherwise I get an errorTypeError: params.programId.toBytes is not a function
. This seems to have regressed in the last day or so.To reproduce, one can run
git clone https://github.com/project-serum/anchor
cd anchor/examples/spl/token-proxy
anchor test
After installing the dependencies here https://github.com/project-serum/anchor/blob/master/.travis.yml#L15.
The text was updated successfully, but these errors were encountered: