-
Notifications
You must be signed in to change notification settings - Fork 324
Open
Description
Been following the buildspace AI avatar generator project and loving it so far!
I did come across an issue when creating the React app. In the bufferToBase64 function:
const bufferToBase64 = (buffer) => {
let arr = new Uint8Array(buffer);
const base64 = btoa(
arr.reduce((data, byte) => data + String.fromCharCode(byte), '')
)
return `data:image/png;base64,${base64}`;
};I had an issue with btoa not being defined:
error - ReferenceError: btoa is not definedI did an npm install --save buffer and added import { btoa } from "buffer"; to pages/api/generate.js which fixed my issue. Not sure if anyone else had the same issue?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels