question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation errors from browsers that dont support globals

See original GitHub issue

Hi

this piece of code:

Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  ? global.TYPED_ARRAY_SUPPORT
  : typedArraySupport()

Does not work on browsers that do not support the global the whole lib crashes

One of such is brave and lately all browsers.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
dmytro-gokuncommented, Jan 20, 2020

@sixcorners I think, most ppl do not use this lib directly. Instead they use “webpack”, which references “node-libs-browser”, which in turn references v 4.9.2 of this lib. And that one has this issue.

3reactions
dmytro-gokuncommented, Oct 11, 2019

@feross Is that an absolute necessity to require “global”? I mean, it just causes pain for the lib users. If it can be fixed, why not fix it? Why cannot you probe it’s existence first, before accessing it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Script errors in Internet Explorer - Browsers - Microsoft Learn
A script error occurs in Internet Explorer, the webpage cannot be displayed correctly and you receive an error message.
Read more >
Handling common JavaScript problems - MDN Web Docs
Incorrectly using functions inside loops that iterate with a global variable (more generally "getting the scope wrong"). For example, in bad- ...
Read more >
javascript - No restricted globals - Stack Overflow
Since eslint is detecting location as an element of window. it will throw the no-restricted-globals error compilation.
Read more >
Top 10 JavaScript errors from 1000+ projects (and how to ...
1. Uncaught TypeError: Cannot read property · 2. TypeError: 'undefined' is not an object (evaluating · 3. TypeError: null is not an object...
Read more >
Script compile error on GOTY edition, page 2 - Forum
Warning [content0]engine\showflags.ws(11): Global native function ... If you don't have this file stop here and I can't help you other than ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found