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.

Library is broken in non-ES6 browsers

See original GitHub issue

All the versions >= 5.0 are broken in browsers that don’t support ES6 because of this line: https://github.com/avoidwork/filesize.js/blob/3a088db57570ff352eb9a33ccdcb9d07c9fcb04d/tsconfig.json#L9

It may potentially break even evergreen browsers because target: "esnext" doesn’t transpile ESNext code at all which means output may contain unstable ES features (stage-4) which are not yet supported by the browsers natively.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
avoidworkcommented, Oct 29, 2019

The company that produces it has had their chief security officer publically state that you shouldn’t use it.

I don’t use webpack, so this isn’t an issue from my pov.

2reactions
th0rcommented, Oct 30, 2019

I didn’t make the change, so open an issue and flag the original author

Hmm, here is the PR with the change: https://github.com/avoidwork/filesize.js/pull/104 And all the commits there are yours.

And here is another opened issue with the same problem: https://github.com/avoidwork/filesize.js/issues/109

Read more comments on GitHub >

github_iconTop Results From Across the Web

Broken in browsers that don't support ES6 syntax natively #863
This causes syntax errors when trying to run the code in a browser that does not support ES6, such as IE11. If the...
Read more >
Handling dependencies in es6 module, intended for node and ...
Yes, the module folder has the dependency (moment-js) installed via npm. Otherwise the import statement would not work at all. The issue is...
Read more >
Why don't modern Internet browsers support ES6 modules yet?
Yes, all modern browsers support ES6 but not at the same level. You can use https://kangax.github.io/compat-table/es6/ to see the overall level of support...
Read more >
ES6 browser support: is it time to rethink bundling? - Contentful
Today we have tree shaking and module bundlers, and we go back to code splitting to not block the main thread on startup...
Read more >
Using ES modules in browsers with import-maps
Well, not really. This approach comes with certain problems. The dependency between different files and shared libraries will become important.
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