Firefox extension update problem -- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data - json

The company I work for has a Firefox extension that we privately distribute so it isn't in the AMO store. We are able to automatically update our extension using a JSON update manifest. The xpi package includes an update.rdf which has a link to the updated xpi file.
I have been through the process of updating our Firefox extension once before without issue. This time, however, when I try to update the extension through the Add-ons Manager, it responds with the message "No updates found." This is what is logged in the browser console:
1561581031192 addons.update-checker WARN onUpdateCheckComplete failed to parse update manifest: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data(resource://gre/modules/addons/AddonUpdateChecker.jsm:288:23) JS Stack trace: onLoad#AddonUpdateChecker.jsm:288:23
UpdateParser/<#AddonUpdateChecker.jsm:239:54
1561581031340 addons.update-checker WARN onUpdateCheckComplete failed to parse update manifest: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data(resource://gre/modules/addons/AddonUpdateChecker.jsm:288:23) JS Stack trace: onLoad#AddonUpdateChecker.jsm:288:23
UpdateParser/<#AddonUpdateChecker.jsm:239:54
There is no obvious unexpected character at line 1 column 1 of my JSON file, nor hidden characters that I am aware of. The code checks out okay on JSONlint.
The only change I made to the JSON file that worked previously was to update the version number so I don't understand why it wouldn't work this time. I have researched the "JSON.parse: unexpected character" error but didn't find anything pertinent to my situation. Any insights into this issue would be greatly appreciated. Thank you!

On the Mozilla add-on forum I received a reply that support for the update.rdf file has been deprecated in Firefox 67 1, the “JSON update manifests” file format should now be used instead: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Updates. I have passed this issue on to our developer to investigate.

Related

golang chromedp ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value

I'm getting ERROR: could not unmarshal event: unknown PrivateNetworkRequestPolicy value while fetching amazon using chromedp. Tried with different user-agents but nothing works.
github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 github.com/chromedp/chromedp v0.8.4
Google Chrome 104.0.5112.79
What is wrong
Google Chrome 104.0.5112.79 has such policies (see browser_protocol.pdl#L6178-L6184):
Allow
BlockFromInsecureToMorePrivate
WarnFromInsecureToMorePrivate
PreflightBlock
PreflightWarn
And github.com/chromedp/cdproto v0.0.0-20220816211547-b8b15824df23 supports the same list of polices (see cdproto).
So the error looks impossible.
What to do next
The last change to PrivateNetworkRequestPolicy is 97.0.4665.1_9.7.3 which adds two new values:
PreflightBlock
PreflightWarn
Please double check the version of the chromedp/cdproto package and the version of the browser.
Now that Chrome 105 has been released, please upgrade to this version. Maybe it will address the issue.
It will be helpful if you can enable the debug log to record what is the invalid value. Enable the debug log like this:
ctx, cancel := chromedp.NewContext(ctx, chromedp.WithDebugf(log.Printf))
updating chromedp to the latest version fixed the issue.
Refer: https://github.com/chromedp/chromedp/issues/797
go list -m github.com/chromedp/cdproto
github.com/chromedp/cdproto v0.0.0-20221126224343-3a0787b8dd28

Laravel + Vue Error in render: "SyntaxError: Unexpected token u in JSON at position 0"

I have a Laravel application with Vue js and until a while ago it was working perfectly. Now when I go to any page that uses Vue js this error appears: [Vue warn]: Error in render: "SyntaxError: Unexpected token u in JSON at position 0".
When I reload the page by clearing the cache (Control + Shift + R on Mac OS) it works again, but when I update without this command the error appears again.
PS: I didn't do any package updates for both laravel and npm, it just stopped working out of nowhere.
Try this in the console:
JSON.parse(undefined)
Here is what you will get:
Uncaught SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse (<anonymous>)
at <anonymous>:1:6
In other words, your app is attempting to parse undefined, which is not valid JSON.
There are two common causes for this. The first is that you may be referencing a non-existent property (or even a non-existent variable if not in strict mode).
window.foobar = '{"some":"data"}';
JSON.parse(window.foobarn) // oops, misspelled!
The second common cause is failure to receive the JSON in the first place, which could be caused by client side scripts that ignore errors and send a request when they shouldn't.
Make sure both your server-side and client-side scripts are running in strict mode and lint them using ESLint. This will give you pretty good confidence that there are no typos.
Sometime it is becaseu of this let data = JSON.parse(this.response); so try to change it to
let data = JSON.parse(this.responseText);
I really did was change this.response to this.responseText

youtube-dl: Failed to parse JSON

I posted a question on this yesterday to the GitHub support page and it got flagged as a duplicate - the original answer is here. This issue doesn't automatically fix like it did for that user. Instead, it seems to come and go with no pattern, so I don't have a good way to replicate it. Some songs will work at one point in time, then they won't a couple minutes later.
Error:
[debug] Encodings: locale cp1252, fs utf-8, out UTF-8, pref cp1252
[debug] youtube-dl version 2020.09.20
[debug] Python version 3.7.8 (CPython) - Windows-10-10.0.19041-SP0
[youtube:search] query "iron man 3 song": Downloading page 1
[debug] exe versions: none
[debug] Proxy map: {}
ERROR: query "song name": Failed to parse JSON caused by JSONDecodeError('Expecting value: line 1 column 1 (char 0)')); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
I get the issue when attempting to extract the data from the video. Here is a snippet of the code I am using:
ydlOps = {
'format': 'bestaudio/best',
'outtmpl': './%(title)s.webm',
'noplaylist': True,
'extractaudio': True,
'audioformat': 'webm',
'default_search': 'ytsearch1',
'quite': True,
'verbose':True,
'version': True
}
with youtube_dl.YoutubeDL(ydlOps) as downloader:
songData = downloader.extract_info(url, download=download)
I have changed the options, tried other options said to have worked, and nothing seems to make a difference. Some will work, then not, then they will again.
I think this is a youtube-dl bug. I wrote a parser for youtube searches and it also broke.
When looking previously at the response from youtube, all the JSON data was stored like this:
window["ytInitialData"] = {...}
So you just had to search through the server's response for the string 'window["ytInitialData"]' to find the relevant JSON and extract it. But now, youtube stores the JSON like this inside the html file sent by the server
var ytInitialData = {...}
This needs to be changed on youtube-dl's part when parsing the results.
What's strange is that sometimes youtube uses the previous version and sometimes it uses the current one. I think it's because the change in javascript is progressively being rolled out accross all youtube servers.
Also note that now, the line containing all the JSON ends with '; ' instead of just ';'. This might also require a change from youtube-dl.
You need to submit a pull request to youtube-dl or wait for somebody to fix it.

Wakanda server start JSON error unexpected EOF

WAK 1.1.3 - during solution load, get a backend error:
[Backend] Error
[Backend] SyntaxError: JSON Parse error: Unexpected EOF
But it is not clear what file has this issue. How to most efficiently isolate this? I see nothing in the logs. The application has been running stably. I assume this is in a method, but am not finding it after a thorough search.
Thanks for guidance.
Kirk
Unexpected EOF error could be as small as forgetting to close function body with a right curly bracket.
I recommend first checking all the code on the backend you have modified since the last successful restart.
Secondly, since this occurs during solution load, the error is likely in bootstrap code including login listener. Or in model.js. You could try comment out all code in bootstrap.js or model.js see if the solution can load.

Appcelerator message = "JSON Parse error: Unexpected identifier \"undefined\"";

I am adding new features to an app I wrote last years and is working now ... I just port the code from Appcelerator (3.2...) to the Appcelerator Studio 5.2.0.GA SDK ... and I have spent 2 days trying to figure out why code that currently works on an app in the app store is not working in the SDK 5.2.0 environment
I keep getting the above error .. I am positive the url is correct and working
This line of code works now in the app in the store and in 3.1... but is not working in 5.2.0
var jsonObject = JSON.parse(this.responseText);
It gives the above error
"JSON Parse error: Unexpected identifier \"undefined\"";
I have read their site and searched for a solution ... Thanks
entire Block
Try one thing:
Open this site and put your response data in which you are getting error https://jsonformatter.curiousconcept.com
After parsing the same data on the above site, you can check whether the problem is really in your Titanium code or in your data.
Also check whether you are really getting any response data or not.
If it does not help, then please share some necessary source code
Thanks