Open soleanos opened 3 years ago
same here
Is there any update on this? Or perhaps any work around?
@soleanos I found a fix for this.
Within you polyfill.ts add the following line of code:
(window as any).global = window;
.
This should be placed after: import 'zone.js'
.
Then in your code you can call a login like this:
async login(): Promise<void> {
const wax = new waxjs.WaxJS({ rpcEndpoint: 'http://wax.greymass.com', userAccount: null, pubKeys: null, tryAutoLogin: false});
const user = await wax.login();
}
For people using Vite + Vue: I resolved this issue by adding a global object to the window for the root view ...
<script setup>
window.global = window
</script>
@gnollio you can also do this:
import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
define: {
global: "globalThis",
}
})
Hello, im trying to implement Waxjs into an Angular app, i did an npm i @waxio/waxjs, then i imported with "import * as waxjs from "@waxio/waxjs/dist";" but when i try to call it with " const wax = new waxjs.WaxJS('https://wax.greymass.com/', undefined, undefined, false); " or new waxjs.WaxJS('https://wax.greymass.com/%27) i have the following issue :
Global is not defined (for the Global.fetch in eosjs-jsonrpc.js line 87) I searched about webpack problms but didnt found something for solve it ( tryed to manualy require global-fetch ..ect) If someone could help me pls, thanks