难得920
难得920
  • 发布:2019-12-17 19:58
  • 更新:2021-03-16 16:34
  • 阅读:18447

uniapp编译报错Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js):

分类:uni-app

uniapp编译报错 Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js):
查了查,说问题在于#ifdef,#ifndef,#endif 于是把所有的都去掉了,但编译还是报这个错误,头疼。

我的工具版本是2.4.5.20191209

20:06:19.324 正在编译中...
20:06:40.086 Module build failed (from ./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js):
20:06:40.092 SyntaxError: Unexpected identifier
20:06:40.100 at new Function (<anonymous>)
20:06:40.104 at getTestTemplate (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:375:10)
20:06:40.109 at testPasses (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:379:16)
20:06:40.115 at D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:176:19
20:06:40.120 at D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:326:22
20:06:40.125 at Array.reduce (<anonymous>)
20:06:40.130 at matchReplacePass (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:313:20)
20:06:40.134 at replaceRecursive (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:333:10)
20:06:40.139 at preprocessor (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:168:10)
20:06:40.144 at Object.preprocess (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-uni\packages\webpack-preprocess-loader\preprocess\lib\preprocess.js:93:10)
20:06:40.149 at Object.module.exports (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\script-new.js:34:26)
20:06:40.154 at Object.module.exports (D:\MyPrograms\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\webpack-uni-mp-loader\lib\script.js:22:36)
20:06:40.158 ERROR Build failed with errors.

2019-12-17 19:58 负责人:无 分享
已邀请:
jetaime

jetaime

这个主要是由于 ifdefendif不匹配导致的,仔细检查一下代码本身哦!

  • 6***@qq.com

    谢谢,查了不是这个原因

    2020-05-12 11:03

DCloud_uni-ad_HDX

DCloud_uni-ad_HDX

请提供一个简单测试工程,或移除一些页面定位问题

麦东西

麦东西 - 代码改变世界

解决了?

zhenyu

zhenyu

同样的错误

i***@163.com

i***@163.com - Luna

解决了吗,遇到同样的

8***@qq.com

8***@qq.com

大佬,解决了吗,我也遇到了

1***@qq.com

1***@qq.com

有可能是import引入路径不对

j***@163.com

j***@163.com - 抽象并不抽象

大佬们,帮帮忙啦

9***@qq.com

9***@qq.com

绑定数据的时候,将{{}}去了试试

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