aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
647 stars 198 forks source link

TypeError: Cannot read properties of undefined (reading 'schemaChange') #701

Closed vincentfretin closed 5 months ago

vincentfretin commented 6 months ago

With aframe master and the index.html in the repo we get

component.js:367 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'schemaChange')
    at n.updateComponent (component.js:367:30)
    at n.updateProperties (component.js:297:12)
    at a.updateComponent (a-entity.js:466:17)
    at a.updateComponents (a-entity.js:442:12)
    at a-entity.js:243:12
    at a-node.js:149:17

and background is black, not sure if this is related. Also environment component needs to be updated to 1.3.3.

vincentfretin commented 5 months ago

Since https://github.com/aframevr/aframe/pull/5426 The error is now

Uncaught (in promise) TypeError: this.schema[n] is undefined

image

mrxz commented 5 months ago

@vincentfretin I think this might be due to server-side caching by jsdelivr, as the error in question should not be possible with the check in place. What the debugger shows is the source mapped version, but when I load the aframe-master.min.js from cdn.jsdelivr.net manually I still see the old incomplete check in place...

image image

I assume this will resolve itself in due time, though no idea how long it might be cached for. Replacing it with an explicit link to the latest commit on master at least shows that the error is gone with the fix:

<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@84bdb3cf4bdba86a20c603f792e283ca13bfba20/dist/aframe-master.min.js"></script>
mrxz commented 5 months ago

Seems the cache might either be 12 hours or 7 days, according to the docs (https://www.jsdelivr.com/documentation#id-caching). I would assume 12 hours, though seeing how master is a fallback for latest in the case of GitHub it might follow the same cache duration(?)

And for context, while https://github.com/aframevr/aframe/pull/5426 resolves the issue, the reason this bug surfaced in the first place is due to the following change in A-Frame: https://github.com/aframevr/aframe/commit/924dc00ecf483c1cd21c01bcadaf53d95911155d, see https://github.com/aframevr/aframe/issues/5425 for discussion. While the exception might be gone additional/incorrect component updates during initialization do still take place. Not sure if there is any negative impact on the inspector and/or example scene, but a heads up in case you notice anything.

vincentfretin commented 5 months ago

Thank you. Good thing to know about the cache duration, I'll keep that in mind next time. I'll close then.