Jump to content

translation.bundle.js SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data


aymeric69001

Recommended Posts

Hello,

 

I am facing a bug that I could not solve.

 

When I want to reach this URL: https://www.example.com/adminaad748s5/index.php/international/translations?lang=fr&type=back&locale=fr-FR&_token=4zRdcMNgY-dsdD748KPHITJTT

Which is the URL generated when you click on "Modify" in the section "Modify translations" in the "Translations" page, see below:

screen1.thumb.png.d156b9f53a845bc6743fd07662a5366a.png

(this 1st image was from my localhost store, just to show you the button translated in english :))

So, when I click on the button (on my store online) I get this result :

 

screenshot1.thumb.png.15ba73e9e5c65337381e3f2efb884d3d.png

 

And inspecting the javascript console I get this:

 

screenshot3.thumb.png.7126f4cde4f3f65f3acd3b97e6fa7190.png

So, I went to see this file: in admin456dsd/themes/new-theme/public/translations-bundle.js, and here is the peace of code corresponding to the error:

 

function(t){n.i(s.a)("error",t.bodyText?JSON.parse(t.bodyText).error:t.statusText)}

(( to recall, the error is: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data ))

 

When I console.log t.bodyText, I obtain 'undefined' so I added a condition like so:

 

if(typeof t.bodyText !== 'undefined'){n.i(s.a)("error",t.bodyText?JSON.parse(t.bodyText).error:t.statusText);}

 

But the code still present the same error (cache is disable).

 

I am really stuck here. Need some help.

 

Here are my configurations: Prestashop 1.7.4.2, Php 7.2, Centos 7

 

Thanks

 

Aymeric

 

 

Link to comment
Share on other sites

  • 1 year later...
  • 9 months later...
On 9/4/2018 at 11:45 PM, aymeric69001 said:

Hello,

 

I am facing a bug that I could not solve.

 

When I want to reach this URL: https://www.example.com/adminaad748s5/index.php/international/translations?lang=fr&type=back&locale=fr-FR&_token=4zRdcMNgY-dsdD748KPHITJTT

Which is the URL generated when you click on "Modify" in the section "Modify translations" in the "Translations" page, see below:

screen1.thumb.png.d156b9f53a845bc6743fd07662a5366a.png

(this 1st image was from my localhost store, just to show you the button translated in english :))

So, when I click on the button (on my store online) I get this result :

 

screenshot1.thumb.png.15ba73e9e5c65337381e3f2efb884d3d.png

 

And inspecting the javascript console I get this:

 

screenshot3.thumb.png.7126f4cde4f3f65f3acd3b97e6fa7190.png

So, I went to see this file: in admin456dsd/themes/new-theme/public/translations-bundle.js, and here is the peace of code corresponding to the error:

 


function(t){n.i(s.a)("error",t.bodyText?JSON.parse(t.bodyText).error:t.statusText)}

(( to recall, the error is: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data ))

 

When I console.log t.bodyText, I obtain 'undefined' so I added a condition like so:

 


if(typeof t.bodyText !== 'undefined'){n.i(s.a)("error",t.bodyText?JSON.parse(t.bodyText).error:t.statusText);}

 

But the code still present the same error (cache is disable).

 

I am really stuck here. Need some help.

 

Here are my configurations: Prestashop 1.7.4.2, Php 7.2, Centos 7

 

Thanks

 

Aymeric

 

 

Hi, 

i am facing same issue, please can you tell me how you had resolved it?

 

Regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...