Closed Bug 1260189 Opened 9 years ago Closed 7 years ago

JSON Viewer fails to load big files with 'TypeError: headers is null'

Categories

(DevTools :: JSON Viewer, defect, P2)

47 Branch
x86_64
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: drno, Unassigned)

References

Details

When I try to load really big json files (~19MB) via the file URL I only get an empty page and the console shows: TypeError: headers is null for this line https://dxr.mozilla.org/mozilla-central/source/devtools/client/jsonview/json-viewer.js#31 Not sure if this is related to bug 1224071 or not.
I've the same issue with a json file (~60MB). It works well with chrome. I can provide the json if needed.
Does your JSON have a NUL (U+0000) character? See bug 1364953.
:Oriol, no it hasn't.
I think the problem was: - require.js was included in the <head> and loaded synchronously - The data-main entry point is viewer-config.js, loaded asynchronously - That loads json-viewer.js, not sure if synchronously or asynchronously Probably, most times json-viewer.js ended up running after the JSON contents and the headers had been appended to the document, but this was not the case for these huge files. In bug 1367894 I inserted require.js after loading the page, so the problem should be fixed now. Can somebody confirm?
Depends on: 1367894
I tried ~84MB json file and it works for me. http://janodvarko.cz/temp/jsonviewer/bigdata.json The JSON Viewer takes some time to appear, but works. Honza
I tried again with mine: https://people-mozilla.org/~cdenizet/callgraph.json And finally firefox crashed: https://crash-stats.mozilla.com/report/index/c5beca70-cb0c-447a-958b-0f9f40170531. Maybe it's because the "json" is just one big array of numbers.
(In reply to Calixte Denizet (:calixte) from comment #6) > I tried again with mine: https://people-mozilla.org/~cdenizet/callgraph.json > And finally firefox crashed: > https://crash-stats.mozilla.com/report/index/c5beca70-cb0c-447a-958b- > 0f9f40170531. > Maybe it's because the "json" is just one big array of numbers. I can confirm. This example crashes the content process. Honza
Before the crash (bug 1369041) I can see that the JSON Viewer has loaded (after waiting a lot and using like 8GB of RAM). So this seems fixed by bug 1367894. And just in case in bug 1368899 I defined headers at the very beginning and deferred the script.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.