You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I initialize a full-stack boilerplate template with create-aptos-dapp with Surf enabled, I encounter the "Uncaught ReferenceError: Buffer is not defined" on the browser when I launch the development server. This is happening because @thalalabs/surf requires the Node.js Buffer module, but it's not available in the browser environment by default. To fix this, we need to add a polyfill for the Buffer in your Vite configuration.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Discord user ID
pigbearr
Describe your question in detail.
When I initialize a full-stack boilerplate template with create-aptos-dapp with Surf enabled, I encounter the "Uncaught ReferenceError: Buffer is not defined" on the browser when I launch the development server. This is happening because @thalalabs/surf requires the Node.js Buffer module, but it's not available in the browser environment by default. To fix this, we need to add a polyfill for the Buffer in your Vite configuration.
I have created an issue on the create-aptos-dapp repo: aptos-labs/create-aptos-dapp#298
What error, if any, are you getting?
Refer to this issue: aptos-labs/create-aptos-dapp#298
What have you tried or looked at? Or how can we reproduce the error?
Refer to this issue: aptos-labs/create-aptos-dapp#298
Which operating system are you using?
macOS
Which SDK or tool are you using? (if any)
TypeScript SDK
Describe your environment or tooling in detail
No response
Beta Was this translation helpful? Give feedback.
All reactions