Executable Posted March 22, 2019 Share Posted March 22, 2019 On every page of my website I have this following error in my console. Quote Uncaught TypeError: Cannot set property 'timestamp' of undefined at Object.save (webspeed.js:22986) at Object.success (webspeed.js:23012) at fire (webspeed.js:3477) at Object.fireWith [as resolveWith] (webspeed.js:3589) at done (webspeed.js:8664) at XMLHttpRequest.callback (webspeed.js:9207) Quote webspeed.js:9135 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://www.speedtest.net/api/connection with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details. I don't what is the root of the problem 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 22, 2019 Share Posted March 22, 2019 (edited) Looks like you have the speedtest's javascript on the pages and it likely needs to be updated. Quick fix would be to remove the webspeed.js <script> tags from where they are included in the templates. That would be custom for your setup, so where that is done at would not be possible for me to say right off without a few guesses. Edited March 22, 2019 by steven99 0 Quote Link to comment Share on other sites More sharing options...
paulocress Posted November 9, 2021 Share Posted November 9, 2021 In JavaScript almost everything is an object, null and undefined are exception. if a variable has been declared, but has not been assigned a value, is automatically assigned the value undefined . Therefore, if you try to access the value of such variable, it will throw Uncaught TypeError cannot set property '0' of undefined/null . JavaScript null and undefined is one of the main reasons to produce a runtime errors . This happens because you don't check the value of unknown return variables before using it. If you are not sure a variable that will always have some value, the best practice is to check the value of variables for null or undefined before using them. The standard way to catch null and undefined simultaneously is this: if (variable == null) { // your code here. } Because null == undefined is true, the above code will catch both null and undefined. Also you can write equivalent to more explicit but less concise: if (variable === undefined variable === null) { // your code here. } This should work for any variable that is either undeclared or declared and explicitly set to null or undefined. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.