Since Editor v2.34.0, two classic scripts in my project show a red “!” in the entity inspector and no attributes:
- ‘videoHotspot’ Script Object is defined in multiple preloaded assets (the Assets panel contains only one videoHotspot.js).
- ‘parallaxBillboard’ Script Object is not defined in any preloaded script assets (parallaxBillboard.js exists).
Restoring the previous, unchanged versions of both scripts does not help. Another classic script edited at the same time (videoPanel.js) still shows its attributes.
Launch works fine: both scripts run with their saved attribute values. Only the entity inspector fails to display them.
Editor console when selecting the entity: TypeError: Cannot read properties of null (reading ‘removeEventListener’) at attributes-inspector.ts:231:27 at Nt.destroy (attributes-inspector.ts:692:15) at VQ.destroy (script.ts:1029:15) at DU.unlink (script.ts:1657:32).
I use Chrome on Windows, and the same happens in another browser.
Hard reload and a single editor tab do not fix it. Could the change “parse classic script attributes in Safari” (#2301) have affected other browsers too ?
Hey! Firstly I would recommend using the Editor MCP - it has access to all editor behaviour so can resolve these issues very quickly.
Secondly - the classic script attributes on Safari is permission related with service workers - it wont have affected existing scripts. Could you add me to your project to take a look? username: kpal
Thanks ! I have added you to the project (user kpal, read access). Please switch to the branch “interactive-panel” (Version Control panel), that is where the issue happens. The entities to look at are “HotspotPulse” (videoHotspot) and “Billboard” (parallaxBillboard), in the BookStore scene. Let me know if you need write access.
Confirmed, the attributes are back on both scripts. Thanks a lot KPal for the quick help !
A correction to what I wrote before: the first version of my changes ran some code at script load time (a window.addEventListener call outside of initialize), which most likely made the automatic parse fail.
After that, the editor kept the broken state even after I saved a fixed version and even the original scripts, so it looked unrelated to my changes. Your manual parse picked up the fixed version.
Maybe worth checking why the automatic re-parse did not recover on save.
For next time, the parse button on the script component was hidden while the error was shown. How can I re-parse a script myself in that situation?
Screenshots: with the error (no edit/parse icons) and after your fix (icons back).