Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does instagram throw "Expected Dict got Mapping" error on browser from time to time?

pyre-fixme[6]: Expected Dict[str, Any] for 2nd param but got # Mapping[str, Any].

like image 392
ishandutta2007 Avatar asked Jun 26 '19 06:06

ishandutta2007


2 Answers

That means that somebody from Instagram staff messed up. Because this message should not be displayed in the production. Never. Programmers use static code analysis to check source code for potential errors before they actually occur. And for some weird reason, the output of that analysis tool got appended to the HTML page:

<meta property="al:android:url" content="https://www.instagram.com/_u/.../" />

# pyre-fixme[6]: Expected `Dict[str, Any]` for 2nd param but got
#  `Mapping[str, Any]`.
<link rel="canonical" href="https://www.instagram.com/.../" />

As you can see, it gets outputted between <meta> and <link> tags, and it's not wrapped in any tag, so browser treats it like a text node. That's why it is displayed on the page when it starts loading.

But since it is located in the <head> tag, once the page is loaded, browser will hide <head> content, because it only should display <body> content.

And I think that's the reason why automated tests can't capture that error, because it's not affecting the final visual layout.

But simple HTML validator could easily catch that error. Anyway, somebody from Instagram should definitely fix it.

Fun fact: Google already indexed this error on 2,100,000 Instagram pages. Try googling site:instagram.com "pyre-fixme"

like image 120
Maxim Mazurok Avatar answered Oct 19 '22 15:10

Maxim Mazurok


This error is from python backend of Instagram. And it is not a error, it is a error from Static Code Analysis: https://pyre-check.org/

like image 33
tres.14159 Avatar answered Oct 19 '22 16:10

tres.14159