Skip to content

js-legacy: Import Buffer explicitly instead of relying on the global - #164

Merged
joncinque merged 2 commits into
solana-program:mainfrom
Iamsohungrynow:fix/js-legacy-explicit-buffer
Nov 23, 2026
Merged

joncinque merged 2 commits into
solana-program:mainfrom
Iamsohungrynow:fix/js-legacy-explicit-buffer

Conversation

@Iamsohungrynow

Copy link
Copy Markdown
Contributor

same fix as solana-program/token-metadata#153, this repo was missed. without a global Buffer all four instruction builders throw ReferenceError: Buffer is not defined

@joncinque joncinque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

Note that Buffer is also used as a type in state/tokenGroup.ts and state/tokenGroupMember.ts, so if we really want to fix this, we should add import type { Buffer } from 'buffer'; to those files too

@Iamsohungrynow
Iamsohungrynow force-pushed the fix/js-legacy-explicit-buffer branch from d1d7599 to 5d3e315 Compare November 23, 2026 18:46
@Iamsohungrynow

Copy link
Copy Markdown
Contributor Author

added it to both state files, the built .d.ts now take Buffer from buffer instead of the global. also rebased onto main for the audit fix

@joncinque joncinque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@joncinque
joncinque merged commit ec5f582 into solana-program:main Nov 23, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants