There was an error while parsing script asset

When i upload my script and parse it , i will got this error…

My code is written in TypeScript and there are no errors locally. Additionally, no errors were detected when uploaded to the online code editor.

So .how to find where is the error ?

@fftidus Can you offer more information or possibly a link to your project so others can have a look?



Lack of any errors suggests to me circular dependency between pc scripts.
It won’t show as an error in a bundler, but Playcanvas Editor will fail to instantiate scripts because of that.

Let me know if that helps.

There are too many classes, making it difficult to identify where there are cyclic references. If it’s only scripts in playcanvas, there are no cyclic references between them.

@attribute({ type: "rgb" ,default: new pc.Color(1, 0, 0, 1)}) 
    public topLeft!: pc.Color;

emmm…I tried to delete each file and finally found the problem. Default values cannot be given here.

You can set default values, but for color I think it should be an array.

@attribute({ type: "rgba" , default: [1, 0, 0, 1]})