Hacker News new | ask | show | jobs
by danlitt 38 days ago
This is the most hilarious JS fail I've ever seen. The entire article renders properly, all the text and styling, then the entire screen is replaced by

"Application error: a client-side exception has occurred (see the browser console for more information)."

It's easy enough to fix, just hammer the refresh button to prevent JS from running.

2 comments

It's such a dream state of JavaScript, that people spent countless of time trying to structure these new web applications in a way so that when one function fails for one button or whatever, it doesn't break the entire client-side view, because that'd be horrible.

So what did the frameworks do? Of course wrap the entire application in one big try/catch, that then changes the entire page as soon as there is any error, instead of presenting users with the information that did load properly. Talk about undoing what the platform and language gives you for free...

This is a poor implementation not a framework problem lol.
> This is a poor implementation not a framework problem lol.

I've seen literally pixel-identical error messages taking over the entire screen when there is a JS error, in exactly that way, across countless of websites. If it's not a framework, it's a library in wide use, because tons of websites have exactly the same issue.

It’s a generic error screen from a framework yes.

But the cause of the error is a poor implementation from the developer.

I can write code that errors out in <insert your favorite language here> does that mean it’s bad?

Read the context first. Initially, we had HTML + JS pages where one function can have one error, and the page keeps on working, because the error didn't block the entire screen.

Now we have some popular framework/library that instead seems to surface these errors that aren't sitting in the top-level scope of the JS application, yet the errors ends up blocking the entire application.

That means it's bad, yes. And it's not any language, we're specifically talking about JS in browsers here.

Modern JS frameworks can absolutely catch and isolate errors. In those cases you’d only see the error in the specific component that had the error. Or if they’re a good dev you as a user won’t even know! You’ll see fallback content.

An error blocking the full screen is a failure on the developer not the tools.

Seems to render perfectly with NoScript blocking all scripts, even with images showing.