Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 8118

Buffer is not defined

$
0
0

I'm trying to execute code on the client side (not react, not node.js):

<script src="https://unpkg.com/@solana/web3.js@latest/lib/index.iife.js"></script><script>...Transaction.from(Buffer.from(tx, 'base64'));...</script>

But i get error: Buffer is not defined

I'm trying:

<script src="https://cdn.jsdelivr.net/npm/@solana/web3.js@latest/lib/index.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/buffer@latest/index.min.js"></script><script>...Transaction.from(Buffer.from(tx, 'base64'));...</script>

But i get error: Buffer.from is not a function.

How to solve this problem? Is it even possible to do this without node.js?


Viewing all articles
Browse latest Browse all 8118

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>