大佬们花两分钟帮忙看下这个问题呗,官方的同学可以帮忙看下吗,我照着文档做的

[preview-error]Uncaught TypeError: Cannot read property ‘binding’ of undefined in http://localhost:7456/scripting/engine/cocos/core/gfx/webgl2/webgl2-commands.js

这是错误信息,我在网上搜了两天也没搜到相关解答,使用cos3d 新建一个项目,其他的啥都没弄,想编译预览一下,就一直报这个错,都是用的内置引擎包,困扰很久了。而且我构建发布到微信小程序却不报错。

这是官方的示例项目,我啥也没改

你好,能把项目发给么?我帮你检查下哪里有问题.

请检查一下这里是否有选择 3.0 ?

我试了下,这三个分支都不行,报的错误和上面一样的
Uncaught TypeError: Cannot read property ‘binding’ of undefined
at WebGL2CmdFuncBindStates (webgl2-commands.ts:2186)
at WebGL2CmdFuncExecuteCmds (webgl2-commands.ts:2604)
at WebGL2GFXPrimaryCommandBuffer.execute (webgl2-primary-command-buffer.ts:107)
at ForwardStage.render (forward-stage.ts:178)
at ForwardFlow.render (render-flow.ts:188)
at ForwardFlow.render (forward-flow.ts:47)
at ForwardPipeline.render (render-pipeline.ts:374)
at Root.frameMove (root.ts:359)
at Director.mainLoop (director.ts:1054)
at callback (game.ts:792)
WebGL2CmdFuncBindStates @ webgl2-commands.ts:2186
WebGL2CmdFuncExecuteCmds @ webgl2-commands.ts:2604
execute @ webgl2-primary-command-buffer.ts:107
render @ forward-stage.ts:178
render @ render-flow.ts:188
render @ forward-flow.ts:47
render @ render-pipeline.ts:374
frameMove @ root.ts:359
mainLoop @ director.ts:1054
callback @ game.ts:792
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
index.js:1 ErrorEvent {isTrusted: true, message: “Uncaught TypeError: Cannot read property ‘binding’ of undefined”, filename: “http://localhost:7456/scripting/engine/cocos/core/gfx/webgl2/webgl2-commands.js”, lineno: 2844, colno: 30…}
(anonymous) @ index.js:1
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785
requestAnimationFrame (async)
callback @ game.ts:785

而且我就算在本地建一个空的只有一个摄像机的3d项目也是这样的情况,发布在微信开发工具预览又是正常的。。。

我们无法复现这个问题,最好发个demo给我们测试一下,好确定问题,顺便提一下,换个浏览器试试看是不是也会这样。

链接:https://pan.baidu.com/s/1Mm9kUNCmAbw2kYC6_DAYdA
提取码:1234
这里上传不了大文件,我传到了百度云盘,麻烦看下你那边是否可以复现

已经测试了你提供的项目包,可以正常使用。。无报错。。你试试换个浏览器试试是不是也会出现这个问题。

谢谢,我觉得可能是我的电脑有问题了。。