Jump to content
aymeric69001

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

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

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More