建站攻略
建站攻略
  • 发布:2019-01-18 20:59
  • 更新:2019-06-14 16:46
  • 阅读:5867

打包提示这个是啥原因,请问有遇到过吗?ERROR TypeError: Cannot read property 'replace' of undefined

分类:uni-app

20:49:08.950 ERROR TypeError: Cannot read property 'replace' of undefined
20:49:08.950 TypeError: Cannot read property 'replace' of undefined
20:49:08.954 at E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\mpvue-template-compiler\build.js:4954:72
20:49:08.955 at Array.forEach (<anonymous>)
20:49:08.959 at convertAst (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\mpvue-template-compiler\build.js:4951:14)
20:49:08.960 at wxmlAst (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\mpvue-template-compiler\build.js:5005:17)
20:49:08.966 at compileToWxml (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\mpvue-template-compiler\build.js:5124:15)
20:49:08.967 at compile (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\compile-to-template.js:36:9)
20:49:08.976 at Object.keys.forEach.filePath (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\generate-components-wxml.js:124:22)
20:49:08.977 at Array.forEach (<anonymous>)
20:49:08.984 at generateComponentsWxml (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\generate-components-wxml.js:77:26)
20:49:08.984 at Promise (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\index.js:128:11)
20:49:08.991 at new Promise (<anonymous>)
20:49:08.992 at compiler.hooks.emit.tapPromise.compilation (E:\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\plugin\index.js:68:14)
20:49:08.998 at _err0 (eval at create (E:\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:13:17)
20:49:08.999 at callback (E:\HBuilderX\plugins\uniapp-cli\node_modules\copy-webpack-plugin\dist\index.js:77:17)
20:49:09.005 at E:\HBuilderX\plugins\uniapp-cli\node_modules\copy-webpack-plugin\dist\index.js:118:24
20:49:09.006 at <anonymous>

2019-01-18 20:59 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com - 大家一起学习!

请问题主问题解决了吗?我也是这样,看到能回复一下吗?急急急急

isboyjc

isboyjc - 一个前端

题主解决了吗,分享一下,谢谢

陆金辉

陆金辉

同问

赵虎威

赵虎威

这个一般是那个变量是空的,所以没有属性,也就不能调用replace方法,所以Cannot read property。

  • 陆金辉

    两个grace组件的挂载方式出现的,但是同样的方式别的项目上就没问题

    2019-03-15 16:09

  • 赵虎威

    回复 陆金辉:是不是少传值了,不然就看看源码,哪里用了replace

    2019-03-15 16:12

陆金辉

陆金辉

graceui版本更新以后,swiper组件不需要再导入和挂载

1***@qq.com

1***@qq.com

请问楼主解决了吗,我也遇到了这个问题

  • 建站攻略 (作者)

    解决了,把所有页面注释,然后一个一个放开,看哪个页面报这个错,然后再去检查语法,

    2019-06-14 16:55

该问题目前已经被锁定, 无法添加新回复