Skip to content Skip to sidebar Skip to footer

Global Is Not Defined At ../node_modules/socket.io-parser/is-buffer.js

thanks in advance for helping me out. I'm trying to connect socket in one of my angular components, but in the console of the browser it throws an error saying that global is not d

Solution 1:

(windowasany).global=window

As already mentioned in comment, add the above code in the polyfills.ts file.

Solution 2:

To fix this issue you need to open the file your_angular_setup/src/polyfills.ts and then add the line below at the bottom of the file.

    (windowasany).global=window

and you will see that your issue is fixed.

Solution 3:

In src/index.html in the head add

<script>varglobal = global || window;
</script>

Post a Comment for "Global Is Not Defined At ../node_modules/socket.io-parser/is-buffer.js"