简单例子Uncaught TypeError: Cannot set property 'spriteFrame' of null

typescript 案例 随便添加一个加载图片的测试代码
功能显示似乎都正确 但是为什么控制台会报错。
Uncaught TypeError: Cannot set property ‘spriteFrame’ of null
2.0.9 2.1.1 都是这样

@ccclass
export default class Helloworld extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    @property(cc.Sprite)
    sprite: cc.Sprite = null;

    @property
    text: string = 'hello 12';

    async start() {
        // init logic
        this.label.string = this.text;
        cc.loader.loadRes("rpgTile005", cc.SpriteFrame, (err, spriteFrame) => {
            if (err) {
                console.log(err)
            }
            this.sprite.spriteFrame = spriteFrame

        });

    }
}

this.sprite 没给值吧 兄得 弃坑吧

给了 不然不会显示出来的

你确定你拉对象给它了?

图片都显示出来了 label 都改了 就是控制台报了错 很烦

方便发个Demo看看吗

参考截图 把helloworld js拖动给label 在把sprite 托给脚本的sprite 用我上面的代码 就报错 但是正确显示了

没复现出来

在搜索栏上找一下都有哪些节点用到了这个组件。
参考这个做法,我找到了Canvas使用了HelloWorld。

用于排查是否哪个节点使用了组件但是你没赋值。

解决了吗?我也是遇到同样的问题,控制台报错很烦