Windows 10 2.3.1版本 Shader 报错

2020-03-05T16:12:59.309Z - normal: Building engine, the initial build will take a long time, please wait a moment.
2020-03-05T16:13:01.171Z - normal: Initializing Cocos2d
2020-03-05T16:13:01.454Z - normal: Initializing engine extends
2020-03-05T16:13:01.946Z - error: __builtin-editor-gizmo-line.effect - gizmo-line-fs:front: error EFX2001: can not resolve #include
at module.exports.import (C:\CocosCreator_2.3.1\resources\app.asar\editor\share\assets\meta\effect.js:1:538)
at C:\CocosCreator_2.3.1\resources\app.asar\asset-db\lib\tasks.js:1:4307
at C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:2952:28
at replenish (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:444:21)
at C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:449:13
at eachOfLimit$1 (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:475:34)
at awaitable(eachOfLimit$1) (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:208:32)
at eachOfSeries (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:662:16)
at awaitable(eachOfSeries) (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:208:32)
2020-03-05T16:13:01.958Z - error: __builtin-editor-gizmo-unlit.effect - gizmo-unlit-fs:front: error EFX2001: can not resolve #include
at module.exports.import (C:\CocosCreator_2.3.1\resources\app.asar\editor\share\assets\meta\effect.js:1:538)
at C:\CocosCreator_2.3.1\resources\app.asar\asset-db\lib\tasks.js:1:4307
at C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:2952:28
at replenish (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:444:21)
at C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:449:13
at eachOfLimit$1 (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:475:34)
at awaitable(eachOfLimit$1) (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:208:32)
at eachOfSeries (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:662:16)
at awaitable(eachOfSeries) (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:208:32)
2020-03-05T16:13:01.968Z - error: __builtin-editor-gizmo.effect - fs: error EFX2001: can not resolve #include
at module.exports.import (C:\CocosCreator_2.3.1\resources\app.asar\editor\share\assets\meta\effect.js:1:538)
at C:\CocosCreator_2.3.1\resources\app.asar\asset-db\lib\tasks.js:1:4307
at C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:2952:28
at replenish (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:444:21)
at C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:449:13
at eachOfLimit$1 (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:475:34)
at awaitable(eachOfLimit$1) (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:208:32)
at eachOfSeries (C:\CocosCreator_2.3.1\resources\app.asar\node_modules\async\dist\async.js:662:16)

什么问题?@jare

看报错是 __builtin-editor-gizmo.effect 语法错误。
你替换一下试试:
__builtin-editor-gizmo.effect.zip (1.5 KB)

把 .CocosCreator 文件夹删掉就能了 也不知道有什么冲突。我后续还遇到了很多问题。看来这版本不好升级。

我也遇到了这个,工程版本升级以后,报好多错,从2.2.2 升级的。分别是:
__builtin-editor-gizmo-line.effect - gizmo-line-fs:front: error EFX2001: can not resolve #include

__builtin-editor-gizmo-unlit.effect - gizmo-unlit-fs:front: error EFX2001: can not resolve #include

__builtin-editor-gizmo.effect - fs: error EFX2001: can not resolve #include

builtin-toon.effect - outline-fs:frag: error EFX2001: can not resolve #include

我们在 2.2.2 升级 2.3.4,同时使用自定义引擎时出现这个问题。

原因是因为自定义引擎中 engine/cocos2d/renderer/build/chunks 文件夹下,缺少了 2.3.4 新增的几个 .inc 文件,如下图所示。把那几个文件拷贝过来就行了。【当然前提是你正确升级了整个自定义引擎。】