I am always getting an Unexpected end of JSON input error after clearing my caches cache:clean | cache:flush. But this error only happens on first page load. When I reload the page again it is gone.

Here are some details:

Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at callback ((index):464)
    at Object.execCb (require.js:1651)
    at Module.check (require.js:867)
    at Module.<anonymous> (require.js:1114)
    at require.js:133
    at require.js:1157
    at each (require.js:58)
    at Module.emit (require.js:1156)
    at Module.check (require.js:918)

I couldnt figure out from where its coming. Does anyone of you has an idead how to fix this or what is causing the error?

1 Answer 1


I had this problem, and I identified that

I had left some cms block with the field

data-mage-init = {

that is,

without closing the tag } json
  • Thank you so much, This solution is helpful to me. Oct 23, 2020 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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