Error JSON.parse Error: Invalid character at position:1 and others

Error JSON.parse Error: Invalid character at position:1 and others

by fran duque -
Number of replies: 5

Hello, I have surffered this error for 2 days ago.

JSON.parse Error: Invalid character at position:1

Another is when I looging, Moodle show and error that said "UNDEFINED" and the window open the error for 3 or 4 times

What can I do? I tried everithing but I am not a developer

Mi site campus.oposicionesjaen.com

Average of ratings: -
In reply to fran duque

Re: Error JSON.parse Error: Invalid character at position:1 and others

by Ken Task -
Picture of Particularly helpful Moodlers

Not much of a clue or debug info ... but ...

Login as admin level user.

Use Site Admin Menu search box ...

search for 'cache' -

Purge all caches

Then search again for 'tour'.

Turn Tours OFF and let's see what happens.  smile

That theme is sure doing a lot of advertising for itself on current site config.  What if you changed themes?

'Sos', Ken


In reply to Ken Task

Re: Error JSON.parse Error: Invalid character at position:1 and others

by fran duque -
The problem is here again.
I found that:
https://moodle.org/mod/forum/discuss.php?d=353411#
But I can't see php.ini
The problem is the same "Unexpected"
In reply to fran duque

Re: Error JSON.parse Error: Invalid character at position:1 and others

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Unfortunately, the initial error simply states that the response from the server includes something incorrect - it doesn't contain enough information to figure out what is incorrect.

What you will need to do is to look through the items found in the "network" tab of your browser's developer tools, in order to locate the response with the badly formatted content (there is a good chance that this contains an obvious error message).

If you post a screenshot of the "network" tab, then someone might be able to guide you as to which of the responses are the most likely to need further investigation.

In reply to Davo Smith

Re: Error JSON.parse Error: Invalid character at position:1 and others

by fran duque -
but that error comes out to all users once they have logged in.
It is not something that only comes to me, I have tried on several computers and several students and all the same all gives the pop-up window of
"Unexpected"
In reply to fran duque

Re: Error JSON.parse Error: Invalid character at position:1 and others

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Fran,

It might happen to lots of different users on your Moodle site, but that still doesn't help to diagnose what is actually going wrong.

The error basically means: "there is something wrong in the response from the server"

To diagnose what that "something wrong" is, you would need to look at the content of the response and figure out why it is wrong. That can only be done by looking at the raw responses as contained in the "network" tab of your browser's developer tools.