threecha / wxappUnpacker

基于node的微信小程序反编译工具,在前人的基础上修复了几个程序报错问题。
GNU General Public License v3.0
113 stars 90 forks source link

error wuConfig.js:49 for (let page of subPackage.pages) { #2

Open charlesouwen opened 1 year ago

charlesouwen commented 1 year ago

Header info: firstMark: 0xbe unknownInfo: 0 infoListLength: 13147 dataLength: 1766220 lastMark: 0xed

File list info: fileCount: 227 Saving files... Unpack done. Split app-service.js and make up configs & wxss & wxml & wxs... deal config ok deal js ok deal wxss.js ok deal css ok C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuConfig.js:49 for (let page of subPackage.pages) { ^

TypeError: subPackage.pages is not iterable at C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuConfig.js:49:45 at C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuLib.js:95:14 at agent (C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuLib.js:64:23) at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)

Node.js v18.17.0

threecha commented 1 year ago

问题已收到 晚些回复您。家里目前迁宽带

---- Replied Message ---- | From | @.> | | Date | 07/31/2023 10:46 | | To | @.> | | Cc | @.***> | | Subject | [threecha/wxappUnpacker] error wuConfig.js:49 for (let page of subPackage.pages) { (Issue #2) |

Header info: firstMark: 0xbe unknownInfo: 0 infoListLength: 13147 dataLength: 1766220 lastMark: 0xed

File list info: fileCount: 227 Saving files... Unpack done. Split app-service.js and make up configs & wxss & wxml & wxs... deal config ok deal js ok deal wxss.js ok deal css ok C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuConfig.js:49 for (let page of subPackage.pages) { ^

TypeError: subPackage.pages is not iterable at C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuConfig.js:49:45 at C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuLib.js:95:14 at agent (C:\Pyhton37\PythonEDU\wxappUnpacker-main\wuLib.js:64:23) at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)

Node.js v18.17.0

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

liao10086 commented 1 year ago

我也遇到同一报错问题,解包没有解出app.json

liao10086 commented 1 year ago

我也遇到同一报错问题,解包没有解出app.json

threecha commented 1 year ago

我也遇到同一报错问题,解包没有解出app.json

您好,麻烦提供下小程序包&报错截图&使用的解包命令。

2478641181 commented 1 year ago

解决了吗 我也这个问题

w193241125 commented 9 months ago

网上找到的一些答案:

1.TypeError: subPackage.pages is not iterable 异常

for (let page of subPackage.pages) { ^

TypeError: subPackage.pages is not iterable 这个异常其实就是简单的subPackage参数为空导致出现的异常,只需要简单修改为下面内容即可

if(subPackage.pages){ for (let page of subPackage.pages) { let items = page.replace(root, ''); newPages.push(items); let subIndex = pages.indexOf(root + items); if (subIndex !== -1) { pages.splice(subIndex, 1); } } } 2.function(env,dd,global){$gwxc=0;var root={“tag”:“wx-page”};root.children=[] 异常 这个原因是因为现目前网上大多的wxappUnpacker-master 包都已经是旧的了,新开发出来的小程序或者升级后的小程序使用旧版本的wxappUnpacker-master 都是难以进行解析了的,主要错误原因就在于,解析page-frame.html文件时候,提取出来的内容导入到VM.run函数中不是一个合法的JavaScript代码格式的内容,导致出现的异常 3.SyntaxError: Unexpected token ‘}‘ 异常处理 出这个异常其实和上面第二个异常的原因一模一样,都是截取出来的字符串传入到JavaScript中不是一段合法的代码导致的

4.Error: This application has not registered any plugins yet. 异常处理 这个就是由于编译下来的小程序存在加载插件的原因,现如今你使用的APPID没有申请这个插件,导致出现的异常,简单做法,直接找到对应的插件,小程序后台进行申请;又或者直接删除加载插件的代码即可;(requirePlugin)

5.Bad attr data-event-params with message 异常处理 这个错误一般由于data-event-params参数设置的格式不符合wxml文件中的格式类似如下:

主要就是{{index:index}}这个格式是wxml中不支持的格式,修改为{{index}}即可处理 6.Unexpected token }异常报错处理(return 内容为空)