-
Couldn't load subscription status.
- Fork 144
Issue 1566 Advice on bugging "can't access dead object" errors #2167
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
base: master
Are you sure you want to change the base?
Issue 1566 Advice on bugging "can't access dead object" errors #2167
Conversation
|
@dotproto can you offer any suggestions on how a developer would go about resolving this error? (e.g., something more specific than identify and prevent access to the DOM objects.) |
|
A couple of options leap to mind. (I kinda fell into the rabbit hole on this one.)
|
|
There's way too much subtly in my last comment. I think the simplest, most actionable guidance we can share is to recommend that developers only log the specific properties they need where possible. If they need to log objects during development, they can use |
|
@dotproto is this just about logs? The original blog post suggested that this issue could prevent the extension from working correctly. Would failing to log information from a dead object have the same effect? |
|
Apologies for the delay on following up on this. I seems I misunderstood the issue that motivated this. I was familiar with dead object references, but not the specific ways folks were using it. My examples focused on logging because that was a quick, easy-to-test scenario to experiment with and show in a short snippet here. Basically, you log something before DevTools has a chance to see the object so it doesn't cache/copy/whatever the object so it can be inspected, then when you open DevTools the underlying DOM object reference can't be resolved and the issue appears. That said, logging as I've done here is just a specific presentation of a more general issue. The main workaround is to store the data needed at the time it is first retrieved rather than trying to look up the data you need later after the reference is no longer valid. @rebloor, if you like, I can address the motivating use cases more directly, but I'll need to set aside some time for that. Let me know :) |
|
@dotproto I couldn't find any conversations that suggested this was a regularly encountered issue. Therefore, as the issue has been open for some time, I'm inclined to go with the minimal information and have updated the PR along those lines. If we should get feedback or see any obvious signs that this is a more widespread problem, we can revisit. |
Add a section to the deep bugging page that provides guidance on resolving "can't access dead object" errors.
Fixes #1566, which in turn addresses issues originally raised in mdn/content#24191.