I was trying to fix an error on my website in Google Chrome. To view the source of the bug, I clicked on the reference in the Chrome DevTools console. However, the "Source" tab in the developer tools showed the message "Content unavailable. Resource not cached".
Step by step:
I clicked on the reference to the error location in the DevTools console ... then I saw this in the Source tab:
Questions
- What does this error mean? When does it occur?
- How can I still see the source to see the location of the error?
I was trying to fix an error on my website in Google Chrome. To view the source of the bug, I clicked on the reference in the Chrome DevTools console. However, the "Source" tab in the developer tools showed the message "Content unavailable. Resource not cached".
Step by step:
I clicked on the reference to the error location in the DevTools console ... then I saw this in the Source tab:
Questions
- What does this error mean? When does it occur?
- How can I still see the source to see the location of the error?
1 Answer
Reset to default 0When does this error occur?
You get this error when you
- Open a website with the DevTools closed
- The website redirects you to another place (!)
- The website you were redirected to throws a JS error from JS code that is inlined in the HTML of the page
- Then, you open the DevTools and view the source
You can reproduce it using this issue report in the Chromium bug tracker.
Video: https://issues.chromium.org/action/issues/365405774/attachments/59254646?download=true
What does it mean?
- It's a direct result of the change in Chromium that was added in response to this issue. Previously, the Source tab was just empty.
- The problem seems to be that the DevTools cannot access the web page cache of the page you visited when there was a redirect.
How to still see the source?
There seems to be no satisfying way. Workarounds include:
- You can refresh the page and hope that you can reproduce the error.
- You can view the source of the page (
Ctrl/Cmd
+Alt/Opt
+U
or Right Click ->View Source
on the page) and manually find the line of the error.
I really hope that there will be a more satisfying solution than the slightly better error message introduced in this commit to Chromium. The issue is really rare, but when it happens it is quite annoying that you cannot see the source of your JS errors.