console reports syntax error for valid json fetched via jquery.ajax
Categories
(Core :: Networking, defect, P4)
Tracking
()
People
(Reporter: shaver, Unassigned)
References
()
Details
Attachments
(3 files)
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Comment 10•10 years ago
|
||
Comment 11•9 years ago
|
||
Updated•9 years ago
|
Updated•9 years ago
|
Updated•9 years ago
|
Updated•7 years ago
|
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 18•7 years ago
|
||
Comment 19•7 years ago
|
||
Comment 20•6 years ago
|
||
Bug still present in Firefox 69.0.
We recently upgraded a few SAP BusinessObjects systems to 4.2 and part of the Central Management Console (CMC) won't render because of this issue.
To reproduce:
- Log into CMC
- Click on "Monitoring"
- Page never loads
In Firefox's console there are five "XML Parsing Error: syntax error" errors. Five files that have .properties extensions, are plain text, the server has sent without a content-type and are being loaded via JQuery (bundled version is 1.7.1).
Renders okay in every other browser I've tried.
Please let me know if there is any other information I can supply to help with this.
For what it's worth I'm also going to log a bug with SAP to ask them to fix the issue on their end (i.e. sending the .properties files without a Content-Type).
Comment 21•6 years ago
|
||
Just realised this is classified as a DevTools bug. The bug isn't in the DevTools, they are working as intended. The problem is in whatever component of Firefox (Gecko I'm guessing) that is taking a guess that a file with no Content-Type is "text/xml".
Comment 22•6 years ago
|
||
Also, I'm seeing this issue on Windows 7. It isn't just a Firefox/Mac issue.
Comment 23•5 years ago
|
||
Hi Nicolas,
The main problem is a
XML Parsing Error: syntax error
Location: https://wax-jujube.glitch.me/mytxt
Line Number 1, Column 1:
when a text file is sent from the server with Content-Type: text; charset=UTF-8
instead of text/plain; charset=UTF-8
(with plain). Firefox seems to assume that it is an XML file and tries to parse resulting in the Parsing error.
Here is a glitch where it can be reproduced: https://wax-jujube.glitch.me/
I've hit this bug now as well in a real world scenario where I do not have influence on what headers the third party server sends. FWIW, in Chrome there's no such XML parsing error.
I use current Nightly on Windows 10.
Probably not a DevTools bug, but something in Gecko/parser. Maybe you can forward to the right department.
Comment 24•5 years ago
|
||
moving to network
Comment 25•5 years ago
|
||
Bug 1502417 looks related, probably even duplicate, and also has STR. There a map on a website does not even load but does so in Chrome, so seems to cause big compat issues.
Also on stackoverflow quite a few people seem to be affected by this bug:
- https://stackoverflow.com/questions/8348476/ajax-using-jquery-syntax-error
- https://stackoverflow.com/questions/51000009/i-keep-getting-this-error-xml-parsing-error-syntax-error-but-still-the-website
Might be a good idea if this bug could be re-triaged by the network group as it is already 6y old.
Comment 26•5 years ago
|
||
(In reply to Jens from comment #23)
Hi Nicolas,
The main problem is a
XML Parsing Error: syntax error Location: https://wax-jujube.glitch.me/mytxt Line Number 1, Column 1:
when a text file is sent from the server with
Content-Type: text; charset=UTF-8
instead oftext/plain; charset=UTF-8
(with plain). Firefox seems to assume that it is an XML file and tries to parse resulting in the Parsing error.
I think text
is not a valid MIME type.
MDN says that a MIME type should always have both a type and a subtype. So, this might be an invalid bug.
What do you think?
Comment 27•5 years ago
|
||
- Regardings web compat:
Well, probably right. I do not know. But this causes web compat issues like seen in Bug 1502417 where a map on a page does not even load. So one could also argue that Chrome is wrong here and file a bug against Chromium. Not sure if they would do something. NI'ing to :miketaylr from web compat team (hope this is right, not sure who else). I guess Chromium falls back to "text/plain" when receiving "text" (not sure). - Regarding error message:
OTOH, I am not sure if the Firefox output of "XML Parsing Error: syntax error" is correct then and should not beInvalid/MIssing MimeType Subtype: Received Content-Type "text" without any Subtype
or similar. The current error message is really misleading.
Comment 28•5 years ago
|
||
Can't watch embedded video at https://animehub.ac/watch/boku-no-hero-academia-sub.15322?ep=160884&s=vservers host as Firefox console returns XML parsing error of the .m3u8. Any plans to address this ?
Comment 29•5 years ago
|
||
:uBlock-user When opening https://animehub.ac/watch/boku-no-hero-academia-sub.15322?ep=160884&s=vservers and DevTools Console I see no message about an XML parsing error. Could you maybe add steps to reproduce and a screenshot? So it's reproducable by whatever team will hopefully handle this. Thank you.
:kershaw Since :miketaylr from the web compat team is not responding and I am not a Mozillian I just NI back to you. Hope you can either forward to another Mozillian or fixed as part of the network team.
Personally, I think that though maybe not same as spec the way Chrome handles the parsing is more lax. Chrome seems to be "tolerant" here. Probably, the most realistic way to handle this is to mimic it.
Comment 30•5 years ago
|
||
:uBlock-user Uh, I could reproduce now. One has to open the page first, and then open the DevTools' console. If the DevTools' console is already open, then the error does not show up. (guess cause the page has some spurious debugger;
statements for obfuscation). See screenshot Auswahl__.png
Comment 31•5 years ago
|
||
Yes, sorry I forgot to add that part of info. I found this to be a Firefox specific bug that started occuring to me, few days ago and as per https://stackoverflow.com/a/51000139 this is specific to Firefox only.
Comment 32•5 years ago
|
||
By "can't watch embedded video", I mean that the video keeps buffering endlessly and then fails, so never plays.
Comment 33•5 years ago
|
||
Sorry for the delay here -- it seems like this issue is really about Firefox defaulting to text/xml
for resources without a declared Content-Type
header, correct? (that's at least the case for the m3u8/HLS video issue described in Comment #28). It's not surprising to me that Firefox and Chrome do something different here. Anne, are you aware of any similar issues this should likely be duped against?
Comment 34•5 years ago
|
||
(In reply to Mike Taylor [:miketaylr] from comment #33)
Sorry for the delay here -- it seems like this issue is really about Firefox defaulting to
text/xml
for resources without a declaredContent-Type
header, correct? (that's at least the case for the m3u8/HLS video issue described in Comment #28).
Yes, and also defaulting to text/xml
for resources that declare Content-Type: text
whereas Chrome defaults to text/plain
for those as described in Comment 23.
(Besides this the console error message is misleading and could be improved)
Comment 35•5 years ago
|
||
text
will fail to parse as a MIME type and per https://xhr.spec.whatwg.org/#response-mime-type it'll then be text/xml
.
I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1053973.
Comment 36•5 years ago
|
||
What about the video failing to play ?
Comment 37•5 years ago
|
||
(In reply to uBlock-user from comment #36)
What about the video failing to play ?
The video fails to play because the server hasn't set the appropriate Content Type header (should be application/x-mpegURL or vnd.apple.mpegURL). You can try to contact the site and ask them to fix it.
Comment 38•5 years ago
|
||
If that's the case then how come the video played all this time ? This issue only started occurring since the past 10-15 days ago.
Comment 39•5 years ago
|
||
(In reply to uBlock-user from comment #38)
If that's the case then how come the video played all this time ? This issue only started occurring since the past 10-15 days ago.
:uBlock-user Many reasons:
a) Site has changed something.
b) Some other change in Firefox has caused it. Try if the error still persists in Nightly (scroll down in https://www.mozilla.org/en-US/firefox/channel/desktop/). If so you might want to use mozregression to find which change causes the bug (regression) and you can report it as a new bug. https://mozilla.github.io/mozregression/
(this post causes like mails to 50 people, so probably worth contacting some other support channel if you need further advice)
Description
•