Library is broken in non-ES6 browsers
See original GitHub issueAll 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:
- Created 4 years ago
- Reactions:1
- Comments:18 (10 by maintainers)
Top 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 >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
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.
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