Typescript cc.Audioclip warning

Typescript cc.Audioclip warning



Code used:

FBaudio = [null];

I am using typescript for my all projects but after upgrading to Cocos Creator 2.0.1, I am getting the warning mentioned below:

Please change the definition of property 'FBaudio' in class 'manager'. Starting from v1.10,
properties in CCClass can not be abbreviated if they are of type RawAsset.
Please use the complete form.
For example, if property is Texture2D's url array, the previous definition is:
    FBaudio: [cc.Texture2D],
Now it should be changed to:
    FBaudio: {
      type: cc.Texture2D, // use 'type:' to define an array of Texture2D objects
      default: []
(This helps us to successfully refactor all RawAssets at v2.0, sorry for the inconvenience. 😰 )

Any help regarding this will appreciated. Thanks :slight_smile:


@pandamicro @jare do you have thoughts on this?


For TS, you can use

    type: [cc.AudioClip],
    default: []
FBaudio: cc.AudioClip[] = [null];


Thanks @jare… I will try this. I am facing few problems in v2.0.1 upgrade in my older projects.
I am trying to update my projects.


@jare @pandamicro @slackmoehrle

Thanks for the help. I have done all the possible changes in my project. But after publishing in Mozilla (v61.0.2) I am getting the below warning. Please help for this if there is any issue about this warning.

Error: WebGL warning: texSubImage2D: Texture has not been initialized prior to a partial upload, forcing the browser to clear it. This may be slow. render-engine.js:8268:6

Error: WebGL warning: texSubImage2D: This operation requires zeroing texture data. This is slow. render-engine.js:8268:6

Error: WebGL warning: Calling gl.clear(0) has no effect.


Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings)


Can you provide a demo for us?



I am attaching the screenshots of the demo. All the images are exported from spine2D.

When I load images using cc.loader.loadRes then **WebGL warning: Calling gl.clear(0) has no effect** . Showing in console on each sprite frame load

Normal loading without cc.loader.loadRes

I guess this would help.


I am not sure what’s wrong with the loader. Is it only in Firefox with Spine that this problem occurs?
Can you attach a demo?


@jare @pandamicro @slackmoehrle

It is giving only in Firefox browser. I have just taken a new hello world file and publish on browser and i got this warning.For demo, take a new file with hello world template and just click on play with browser. In console it gives the warning. I am attaching the image of that too.


@jare @pandamicro @slackmoehrle

Hi… Any help. Still getting same warning. Thanks


So, it seems that there are some warnings in Firefox, and this is not related to TypeScript and AudioClip. You can just ignore the warnings.


ok… Ya its only shows in Mozilla. Chrome and Internet Explorer doesn’t show any warning. Thanks.