1

Product detail page showing this error for some products

Uncaught SyntaxError: Unexpected token B in JSON at position 121<br>
   at JSON.parse (<anonymous>)
   at getData (main.js:58)
   at Array.map (<anonymous>)
   at HTMLDocument.apply (main.js:74)
   at fire (jquery.js:3232)
   at Object.fireWith [as resolveWith] (jquery.js:3362)
   at Function.ready (jquery.js:3582)
   at HTMLDocument.completed (jquery.js:3617)

Please help me to fix this....

3
  • hey please mark my answers if solve your issue
    – Sourav
    May 21, 2018 at 9:16
  • No luck. Error still there. May 21, 2018 at 9:45
  • deploy content again
    – Sourav
    May 21, 2018 at 9:58

3 Answers 3

1

So, since you did not specify the code, the error indicates that there are invalid tags in JSON, you need to look in JS for non-closed constructions.

0

Replace this app/design/frontend/vendor/theme/Magento_Catalog/templates/product/view/gallery.phtml

With this file vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml

0

I found the solution by renaming the following file:

app/design/frontend/mytheme/Magento_Catalog/templates/product/view/gallery.phtml

to

app/design/frontend/mytheme/Magento_Catalog/templates/product/view/_gallery.phtml

After that run all magento commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.