雀儿
雀儿
  • 发布:2019-05-13 16:24
  • 更新:2019-08-23 16:33
  • 阅读:4218

关于微信小程序转成uni-app的问题

分类:uni-app

问题如下:我想把微信小程序转成uni-app,根据【微信小程序转换uni-app详细指南】修改后,开始编译运行,却报了下的错误,百度了很久都没找到解决方法,特来请教大家

16:10:05.743 项目 'wxmall' 开始编译...  
16:10:14.600 Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):  
16:10:14.600 ModuleNotFoundError: Module not found: Error: Can't resolve '../static/icon_collection.png' in 'C:\Users\hp\Documents\HBuilderProjects\wxmall'  
16:10:14.605     at factory.create (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\Compilation.js:821:10)  
16:10:14.605     at factory (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\NormalModuleFactory.js:397:22)  
16:10:14.611     at resolver (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\NormalModuleFactory.js:130:21)  
16:10:14.611     at asyncLib.parallel (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\NormalModuleFactory.js:224:22)  
16:10:14.619     at D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\neo-async\async.js:2825:7  
16:10:14.619     at D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\neo-async\async.js:6886:13  
16:10:14.626     at normalResolver.resolve (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\NormalModuleFactory.js:214:25)  
16:10:14.627     at doResolve (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\enhanced-resolve\lib\Resolver.js:184:12)  
16:10:14.636     at hook.callAsync (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\enhanced-resolve\lib\Resolver.js:238:5)  
16:10:14.637     at _fn0 (eval at create (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:15:1)  
16:10:14.645     at resolver.doResolve (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:37:5)  
16:10:14.646     at hook.callAsync (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\enhanced-resolve\lib\Resolver.js:238:5)  
16:10:14.656     at _fn0 (eval at create (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:15:1)  
16:10:14.656     at hook.callAsync (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\enhanced-resolve\lib\Resolver.js:238:5)  
16:10:14.669     at _fn1 (eval at create (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:24:1)  
16:10:14.670     at hook.callAsync (D:\Program Files\HBuilderX\plugins\uniapp-cli\node_modules\enhanced-resolve\lib\Resolver.js:238:5)  
16:10:14.680 Module build failed (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):  
16:10:14.681 语法错误: Unexpected token, expected "," (1:1049)  
16:10:14.692       at pages\index\index.vue:1  
16:10:14.693  ERROR  Build failed with errors.
2019-05-13 16:24 负责人:无 分享
已邀请:
s***@aliyun.com

s***@aliyun.com - good good study , today today up

没有找到图片:icon_collection.png

zhangdaren

zhangdaren - 小程序转uniapp工具:https://ext.dcloud.net.cn/plugin?id=2656

大佬可以试试这个转换器啊,使用文档:http://ask.dcloud.net.cn/article/36037

  • 3***@qq.com

    你好,我用的这个转换器转换的微信小程序,但是转换后一堆报错。其中 因为转换器不支持转换wxParse,该怎么办呢?

    2019-09-04 15:44

zhangdaren

zhangdaren - 小程序转uniapp工具:https://ext.dcloud.net.cn/plugin?id=2656

资源没有找到,,原因是uni-app编译后,会将所以非static目录下面的资源文件,全部删除掉!!!

所以再次编译后找不到图片了,需要放到static目录下,才不会被删除。

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