Uncaught SyntaxError: Unexpected non-whitespace character after JSON at position x at JSON.parse

Website URL

https://3d-car-visualizer.free.nf/

Error Message

Uncaught SyntaxError: Unexpected non-whitespace character after JSON at position x (line y column z)
at JSON.parse ()

Other Information

The website works fine in local mode.
Then I uploaded it to IF, now I’m getting this weird error.
I checked my json files and they are all valid (RFC 8259).

I added a console.log to display JSON files urls.

I don’t understand what’s happening.
Thanks for your help.

Hi and welcome to the forum

This file https://3d-car-visualizer.free.nf/models/carvisualizer.mazda_bumper.js
and maybe some more

image

image


I went in order and blocked every JSON through the browser dev tools (network tab) and enabled them one by one plus refresh until I got that error

5 Likes

Hi and thank you Oxy,

You are right, I ckecked it and it’s not valid.
Maybe I have missed some json files in my validation process.
I’m going to check them again.
Thanks, you are the best :wink:

2 Likes

NP - I think you have a duplicate code
maybe you accidentally pressed CTRL + V twice

4 Likes

You are right again, it’s very likely the case.
Thanks again my friend :wink:

2 Likes

I fixed the files that contained duplicate code, and now everything is back to normal :grinning:

2 Likes

Congratulations, I’m glad you made it :wink:
And thanks for the feedback !

Good luck with your further work on your website

3 Likes

Thank you my friend for your valuable help and your kindness :wink:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.