Im getting this warning when loading
coming from : frameworks/cocos2d-html5/CCBoot.js:781
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/
Also getting this when doing cocos run -p web, but its also giving me the error âUncaught TypeError: Cannot read property âstyleâ of nullâ on CCBoot.js:729 that causes my app to not start 
It seems like the canvas element in CCBoot.js is null due to something not loading correctly. How can I go about solving this problem?
Edit the index.html file such that the script for cocos2djs (or ccboot.js) is included at the end of the body rather than in the . When included in the head, the current version of cocos tries to make changes to the DOM even beofre its ready.
@Nambiar
Thanks but it doesât work
Well according to documentation
and google it is chrome thing when setting xhttp open async to false âŚ
changing it to true , give other errors
Oh my reply was meant as a solution to @Benzilla 's problem.
The deprecation warning is something iâm not really sure about.
This warning is given on loading project.json if you put the content of project.json into document[âccConfigâ] it wonât try to load it and you wont get the warning.
in your html put something like this using the content of your own project.json:
<script id=âccConfigâ>
(document[âccConfigâ] = {
âproject_typeâ: âjavascriptâ,
"debugMode" : 1,
"showFPS" : true,
"frameRate" : 60,
"noCache" : false,
"id" : "gameCanvas",
"renderMode" : 0,
"engineDir":"frameworks/cocos2d-html5",
"modules" : ["cocos2d","ccui"],
"jsList" : [
"src/resource.js",
"src/app.js"
]
});
</script>
1 Like