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.

Errors thrown in `render()` swallowed

See original GitHub issue

Since Promise.resolve().then(...) is used for deferring to another tick, any errors thrown inside render () { ... } gets silently thrown away. At least in Safari TP 15, I think that some other browsers reports unhandled rejections.

This is very unintuitive when developing since there is no way to see what went wrong.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
developitcommented, Apr 3, 2017

@robertknight Yes, absolutely we can re-open. FWIW I think we should probably switch (back) to setTimeout for debouncing since it fixes this and is smaller.

1reaction
jakearchibaldcommented, Oct 26, 2016

If it continues to be a bad user experience for devs, preact could do:

p.catch(err => {
  console.error(err);
  throw err;
});

…at the end of its promise chains.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render errors swallowed with React 15 · Issue #1581 - GitHub
With the solution proposed the error will indeed be thrown on React 15. But React 16+ user will have the error thrown two...
Read more >
ember render hbs swallowing thrown error - Stack Overflow
I prepared a twiddle to illustrate the case; but surprisingly it works in twiddle. However; when I created a brand new ember application;...
Read more >
How to prevent promises swallowing errors ? - GeeksforGeeks
In this article, we will try to understand how we may prevent the promises swallowing errors using several predefined techniques provided by ...
Read more >
Error Boundaries - React
Use static getDerivedStateFromError() to render a fallback UI after an error has been thrown. Use componentDidCatch() to log error information.
Read more >
Are JavaScript Promises swallowing your errors?
JavaScript Promises swallow your errors by default, causing untold pain while debugging. Learn how to keep yourself sane by handling errors ...
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