-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Bug: devtools: throws JSON.parse exception. #20387
Comments
waho |
It doesn't look like this bug report has enough info for one of us to reproduce it. Please provide a CodeSandbox (https://react.new/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve |
@Iipal Information that would be helpful:
|
|
@Iipal To be clear, this only happens for you on your local host? and only before you run the |
@bvaughn yes |
Okay so what's happening here is this: DevTools overrides the Not all errors/warnings are related to React though. For example, the one you are reporting is not. But because DevTools overrides the console method, the browser console displays the error as though it was coming from DevTools rather than the actual call sight. This is kind of unfortunate but I don't know of a way to work around this. This problem is discussed in more detail (along with my wish for a better API) here if you're curious: |
@bvaughn okay, i understood, something. But there is another problem what i just discovered. after this happened the Components tab in browser devtools doesn't work too :c |
@mntnoe Any idea how to repro this (the initial saving of an empty string?) Regardless, any interest in submitting a fix? |
@bvaughn Hmm, looking at the source code, there is only one place where Maybe it is an issue from Firefox Sync? I was able to fix the problem locally by removing the item:
The faulty state can be reintroduced like this:
As remembering the last selection is not a critical feature, we could consider surrounding
The storage item will be written (and corrected) again next time something is inspected by the user. |
Yeah, it's not clear how it go corrupted but it seems unfortunate that we don't recover gracefully. So catching and logging a warning (and also clearing the corrupt storage) would be good. |
React version: ^17.0.1
Steps To Reproduce
I'll be glad to give you more info but i don't know where to search for any about this.
The text was updated successfully, but these errors were encountered: