I wanna send a transaction. Buffer isnât drfi ied though. I am using the browser solana bundle.
I used bundlify to bundle it. Still same error
I wanna send a transaction. Buffer isnât drfi ied though. I am using the browser solana bundle.
I used bundlify to bundle it. Still same error
Can you post in code how youâre using Solana? Are you on the latest Moralis SDK?
For Buffer is not defined these links may help:
Uncaught ReferenceError: Buffer is not defined ¡ Issue #1626 ¡ evanw/esbuild (github.com)
node.js - Uncaught ReferenceError: Buffer is not defined - Stack Overflow
Hi Impare,
You are getting this error since you are using the browser bundle given by Solana. The browser bundle does not contain all the dependencies required for running the Solana/web3js module.
You have to install the dependencies by yourself.
This is how I solved it:
$ npm i @solana/web3.js
The file contains:
var solanaWeb3 = require('@solana/web3.js');
Install browserify if you havenât. Use this command to browserify and bundle up the âsolanaWeb3js-input.jsâ file:
browserify -r @solana/web3.js -s solanaWeb3 -o solanaWeb3.browser.js
Place the âsolanaWeb3.browser.jsâ file in a script tag in your code and youâre good to go.
Regards,
Configentia