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.

Use of miniKindOf is not ES5-compliant

See original GitHub issue

Prior Issues

None that I could find.

What is the current behavior?

Redux causes my application to crash on some ES5 browsers because of a nested function within an if statement in kindOf.ts. This is not permitted in ES5 and Babel does not seem to provide a transform for this, probably because it would break existing code.

The exact console log is this: SyntaxError: Nested functions cannot be declared in strict mode.

Steps to Reproduce

It’s a bit hard to create a live repro case for this, since finding an ES5 browser is difficult nowadays. However, I can provide a gist with my Babel and browserslist configurations as well as a file highlighting the issue.

What is the expected behavior?

Redux should run in an ES5 environment with a standard Babel configuration.

Environment Details

Browser: Midori 0.5.11 on Ubuntu 18.04

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
timdorrcommented, Aug 3, 2021
1reaction
markeriksoncommented, May 22, 2021

Yeah, definitely a pretty rare edge case 😃

tbh this is low priority for me atm, as we’re focusing on getting the RTK Query APIs out the door. If you’d like to submit a PR that rearranges the code to make this work as expected, we can look at getting that in.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ECMAScript 5 | Can I use... Support tables for HTML5, CSS3, etc
Full support for the ECMAScript 5 specification. Features include Function.prototype.bind , Array methods like indexOf , forEach , map & filter , Object...
Read more >
Is there a place to test if code is ES5 compliant / safe?
Sometimes I'd like to know if the code I'm writing is ES5 compliant/safe or not.
Read more >
ECMAScript 5 compatibility table
Compilers/polyfills Desktop brows... Feature name▻ Current browser 100% es5‑shim 31% Konq 4.13 61% §Object/array literal extensions▻ 5/5 0/5 3/5 §Getter accessorsc Yes ? Yes
Read more >
Transpile your javascript to be ES5-compatible - signageOS
In order to use advanced Javascript's features and syntax, you need to either transpile your code to ES5 or use polyfills.
Read more >
How ReactJS ES6 syntax is different compared to ES5
ES5 uses the require module to import any member module in our ... than ES5 as it is a recent update on ES5...
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