-
Notifications
You must be signed in to change notification settings - Fork 925
global is not defined on initialization of library #1036
Comments
@joaoeudes7 did you fix this issue? |
Bumping also hitting this problem with Vite and Parcel. |
Great, thanks @NorbertBodziony |
Sorry for the delay in responding, @jstarry, @NorbertBodziony But you can resolve this problem of issue in specific, add this code in you html base (of public folder) <script>
if (global === undefined) {
var global = window;
}
</script> |
Thanks, @joaoeudes7. I think webpack 5 will also not work with node modules in browser. |
Just tested and made a small vanilla repro here: https://github.com/Standaa/vite-pg |
Seems like web3 package also does not work vitejs/vite#3817 |
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up. |
I give this error on initialization of library, i don't know which dependency is using
text-encode-uft-8
and define to use global (and if it is really necessary), sorry if i'm posting in the wrong place, but the error is ending in this library (Thrill beborsh
orbs58
).The console show the error:
The file in reference shows the use from "./node_modules/@solana/web3.js/lib/index.browser.esm.js":
See
typeof global.TextDecoder
andconst encoding = __importStar(require("text-encoding-utf-8"))
About my project:
Browser: Firefox Developer 89
The text was updated successfully, but these errors were encountered: