Getting error TypeError: Cannot set properties of undefined (setting 'endEventIdx')
When we are running profiler on any page after some time we get this error;
TypeError: Cannot set properties of undefined (setting 'endEventIdx')
Please fix it ASAP.
Thanks
Please fix it ASAP.
I think there is something you don't understand about OSS
Yes, please help in understanding the same. :-)
frame is undefined in this case.
You can see the code there: https://github.com/search?q=repo%3ANoiseByNorthwest%2Fphp-spx%20endEventIdx&type=code
That means in this case the array has no elements or an element with undefined as value (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop), which can be easily checked.
Pullrequests are welcome @engcom-Hotel.
I don't see what could cause this.stack.pop() to return undefined here except a corrupted report.
@engcom-Hotel can you share a screenshot of all errors that appear in the browser console, when this happens?
A see in this line
https://github.com/NoiseByNorthwest/php-spx/blob/f44a010125d918d1c93104c93506b65d4cb14b0a/assets/web-ui/js/profileData.js#L1270
in my last profile, event[1] value is 0, and this gave me the error TypeError: Cannot set properties of undefined (setting 'endEventIdx').
So, Is event[1] = 0 a correct value for this? Because if so, you just need to change the line if (event[1]) to if (event[1] >= 0).
If it's ok, I can make the change.
If it's ok, I can make the change.
event[1] is an integer with 1 (call start) or 0 (call end) as possible values. So if event[1] is equal to 0 (call end) and this.stack is empty then the report is probably corrupted.