[bug] global is not defined
See original GitHub issueNote: for support questions, please use one of these channels: stackoverflow or slack
You want to:
- [x] report a *bug*
- [ ] request a *feature*
Current behaviour
socket.io-client doesn’t work with @angular/cli@1.5.0-rc.3 because of a dependency on node.js’ global
var
(seems to come from has-binary2@1.0.2
, but I can’t find who maintains that versions)
Steps to reproduce (if the current behaviour is a bug)
see https://github.com/angular/angular-cli/issues/8160
Expected behaviour
Setup
- OS:
- browser:
- socket.io version:
2.0.4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:28
- Comments:53 (15 by maintainers)
Top Results From Across the Web
How to fix the ReferenceError: global is not defined error in ...
That sound simple enough to fix, just create a vite. config. [js/ts] file, add it to your SvelteKit project and define global right?...
Read more >Uncaught ReferenceError: global is not defined #2141 - GitHub
ncaught ReferenceError : global is not defined at Object. ... It seems slightly related to the aforementioned bug.
Read more >Uncaught ReferenceError: global is not defined - Stack Overflow
The global object is not available. Possible solution to change it to window object. Share.
Read more >Uncaught ReferenceError: global is not defined - YouTube
Uncaught ReferenceError: global is not defined at node_modules/@walletconnect/socket-transport/dist/esm/index.jscreate a n ew filw named ...
Read more >index.js:43 uncaught referenceerror: global is not defined
Bug report ... Following #8160 I found that it is still possible to cause the global ist not defined error without installing a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
According to https://github.com/angular/angular-cli/issues/8160#issuecomment-386153833:
adding the following
polyfills.ts
should work inAngular@6
:In any case, this issue should not be resolved IMO, socket.io-client should either remove the implicit dependency on
global
, or document that a polyfill is needed (by anyone using the pre-bundled sources, not just Angular users)(BTW where are the sources for latest
has-binary2@1.0.2
? maybe I could help)Put this in your
polyfills.ts