以前项目是非自定义组件模式的,向自定义组件模式切换时,项目代码不报错,但是编译时报下面的错,非自定义模式下没有问题,
Module build failed (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
10:42:43.714 TypeError: Cannot read property 'charAt' of undefined
10:42:43.728 at parseEvent (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:181:20)
10:42:43.780 at _processEvent (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:328:9)
10:42:43.793 at processEvent (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\event.js:387:5)
10:42:43.813 at processes.forEach.process (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:34:5)
10:42:43.814 at Array.forEach (<anonymous>)
10:42:43.830 at traverseData (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\data\index.js:33:13)
10:42:43.831 at Object.CallExpression (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\lib\script\traverse\visitor.js:165:56)
10:42:43.849 at NodePath._call (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\path\context.js:53:20)
10:42:43.850 at NodePath.call (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\path\context.js:40:17)
10:42:43.870 at NodePath.visit (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\path\context.js:88:12)
10:42:43.871 at TraversalContext.visitQueue (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\context.js:118:16)
10:42:43.893 at TraversalContext.visitMultiple (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\context.js:85:17)
10:42:43.894 at TraversalContext.visit (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\context.js:144:19)
10:42:43.917 at Function.traverse.node (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\index.js:94:17)
10:42:43.918 at NodePath.visit (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\path\context.js:95:18)
10:42:43.951 at TraversalContext.visitQueue (D:\软件\HBuilderX.2.1.1.20190716.full\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\uni-template-compiler\node_modules\@babel\traverse\lib\context.js:118:16)
10:42:43.991 ERROR Build failed with errors.
1***@163.com (作者)
谢谢。已经排查完了
2019-08-16 10:55