Open GrayYoung opened 1 year ago
//I'm not familiar with angular , The solution to the vue
//1. npm install buffer
//2.in main.js(Vue)
import * as buffer from "buffer";
if (typeof (window as any).global === "undefined"){
(window as any).global = window;
}
if (typeof (window as any).Buffer === "undefined") {
(window as any).Buffer = buffer.Buffer;
}
I am using this library in an angular project. After starting the server will throw an error telling "global is undefined". And global doesn't exist in window by default.