Skip to content

fix(devtools): implement signal read error handling in DevTools #61911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AleksanderBodurri
Copy link
Member

@AleksanderBodurri AleksanderBodurri commented Jun 5, 2025

Fixes: #61900

Previously in DevTools we would read signal values to display preview values in the UI without safely catching any errors thrown in their evaluations.

Now those signal functions are run in a safe context, their errors are caught and handled in the UI as well as replayed in the console.

Screenshot 2025-06-05 at 3 56 21 PM

@ngbot ngbot bot added this to the Backlog milestone Jun 5, 2025
Fixes: angular#61900

Previously in DevTools we would read signal values to display preview values in the UI without safely catching any errors thrown in their evaluations.

Now those signal functions are run in a safe context, their errors are caught and handled in the UI as well as replayed in the console.
const value = signal();
return {error: undefined, value};
} catch (error) {
console.error('[Angular DevTools]: Error reading signal value:', error);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @dgp1130 mentionned recently, we should probably start having a better logging strategy to not polute the browsers console. WDYT ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more ok with user-meaningful errors like this, rather than noise about internal work going on. But ideally the error would be reported in the UI directly rather than directing users to the console.

I probably wouldn't block on that, as printing a nicer error to the console is better than what we have today. I'd probably think of it as an opportunity to improve this later on.

@thePunderWoman thePunderWoman added the target: minor This PR is targeted for the next minor release label Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: devtools target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular DevTools crashes when clicking into some components
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy