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

RESOLVED FIXED

Status

()

Firefox
Developer Tools: JSON Viewer
P2
normal
RESOLVED FIXED
2 years ago
6 months ago

People

(Reporter: drno, Unassigned)

Tracking

(Blocks: 1 bug)

47 Branch
x86_64
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
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.
Blocks: 1309242
Priority: -- → P2
I've the same issue with a json file (~60MB). It works well with chrome. I can provide the json if needed.

Comment 2

6 months ago
Does your JSON have a NUL (U+0000) character? See bug 1364953.
:Oriol, no it hasn't.

Comment 4

6 months ago
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

Comment 8

6 months ago
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
Last Resolved: 6 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.