AlmostEfficient / full-stack-solana-dev

Anchor + Rust + React Solana app from scratch. Video walkthrough below.
https://youtu.be/vUHF1X48zM4
Creative Commons Zero v1.0 Universal
27 stars 15 forks source link

Uncaught ReferenceError: Buffer is not defined #6

Open domkoder opened 3 months ago

domkoder commented 3 months ago

After I added the code to read data from the program I got a blank page and some errors on the console Screenshot from 2024-06-07 16-30-32

0xpolarzero commented 1 week ago

For reference, easiest fix is:

  1. Add vite-plugin-node-polyfills
  2. Update vite.config.ts:
    
    import { defineConfig } from 'vite';
    import react from '@vitejs/plugin-react';
    import { nodePolyfills } from 'vite-plugin-node-polyfills';

// https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), nodePolyfills()], });