Cannot read properties of undefined (reading 'scripts']

Out of nowhere it error occurs when i try to reload my UIManager script. I have tried restarting, reloading chrome, logout/in playcanvas, removed cookies - nothing worked.

I even reverted back the changes i made in the script that i was working on, and still this error happens

this even happens to other scripts (even the ones i havent made any changes to)

Does this work if you use an older version of the engine? Go to settings and change it there

Possible fix in flight fix(build): keep UMD exports overridable while preserving live bindings by mvaligursky · Pull Request #8839 · playcanvas/engine · GitHub

The oldest version that we have is v2.18.2, but it still not fixes this issue :frowning:

yes sorry 2.19.4 is rolling out now, reload the editor in few minutes and see if that is gone

1 Like

Was there not a 2.17.X option?

Edit: oh the latest version is 2.19.X :thinking:

The fix is now live, please reload the editor

Odd that 2.18 still has the same issue :thinking:

all my scripts stopped working (got not registered)
I used ES6 classes extending pc.ScriptType and then registering them
All stopped working with 2.19.3. Only adding the second argument to pc.registerScript with the script name and replacing it on the entity fixed the problem. Not cool though, I got hundreds of scripts.

@mvaligursky and @KPal ^

any additional info on this @Dmytro_Khudiiash - are you able to share a repro? Is this engine only code or Editor code?

unable to share, under NDA. Engine only code.
basically I got my scripts written as follows:

class Weapon extends pc.ScriptType {

}
pc.registerScript(Weapon);

and all the scripts that did not have that second optional argument with the script name didn’t survive. Had to add a name and reattach.

We had an issue where the Weapon name was used directly, but other scripts use camel case.
so MyWeaponClass would internally register under MyWeaponClass, but now it is unified to myWeaponClass.

But agree this is not ideal, and I’m changing the script registration to register under both MyWeaponClass and myWeaponClass names. Fix incoming.

1 Like

ok the fix is being released, your old code should work again when done.
thanks for the report, and sorry about breaking it.

ive been using v2.19
and yes, the issue seems to have been fixed. Thanks!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.