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.

Reef pollyfill version throws "Invalid operand to 'in': Object expected" error in IE11

See original GitHub issue

Getting the following error in IE11 using the polyfill version of Reef.

Unhandled promise rejection TypeError: Invalid operand to 'in': Object expected
   "Unhandled promise rejection"
      [functions]: ,
      __proto__: { },
      description: "Invalid operand to 'in': Object expected",
      message: "Invalid operand to 'in': Object expected",
      name: "TypeError",
      number: -2146823281,
      stack: "TypeError: Invalid operand to 'in': Object expected
   at stringToHTML (eval code:755:5)
   at Reef.prototype.render (eval code:814:3)
   at Anonymous function (eval code:738:28)
   at Anonymous function (eval code:32:7)
   at forEach (eval code:16:3)
   at renderPolyps (eval code:736:3)
   at Reef.prototype.render (eval code:818:3)
   at displayData (eval code:174:3)
   at _callee$ (eval code:63:13)
   at tryCatch (eval code:43:7)"

For me at least, the str argument being passed into stringToHTML is empty.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

cferdinandicommented, Nov 30, 2020

@aalfiann Thanks for that test case! Just pushed version 7.6.2, which should address this bug.

aalfianncommented, Nov 30, 2020


I found the another problem causes invalid operand to ‘in’

The reduced case test >>

Actual problem is we can’t return empty string in IE11.

Or maybe I miss something?

Example case :

if (props.component.length > 0) {
  return props.component.length; // this work
} else {
  // return ''; // this won't work in IE11
  // return ""; // this won't work in IE11
  retun '<div></div>'; THIS WORK

Is there another clean or better way?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid operand to 'in': Object expected · Issue #2626 - GitHub
What is the expected behavior? It should load scroller tab. What is the actual behavior? it is not instantiated due to error Invalid...
Read more >
jQuery and IE 11 Invalid operand to 'in' - Stack Overflow
We have an application, and when I test it in IE11, it show this. Invalid operand to 'in': Object expected and it is...
Read more >
Angular < 13: How to support IE11 - DEV Community ‍ ‍
Step 1 - Targeting ES5 · "compilerOptions": { ... "target": "es5" } ; Step 2 - Update broswerlist · not IE 9-10 IE...
Read more >
Is your Vue app not working in IE 11? Here's how to fix it.
Here's some of the errors you might have encountered when running your Vue app in IE 11: SCRIPT1002: Syntax error; SCRIPT5022: Exception thrown...
Read more >
Internet Explorer 11 and Angular 2+ | by Maarten Merken | Agilix
When using the IE11 developer tools, Angular throws the 'Can't execute code from a freed script' error. The most efficient way to fix...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found