Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译wxss文件时,$gwx is not defined #187

Open
honhole opened this issue Jan 9, 2019 · 19 comments

Comments

Projects
None yet
10 participants
@honhole
Copy link

commented Jan 9, 2019

报错信息如下 ,麻烦帮我看一下 ,谢谢

C:\nodejs\wxappUnpacker-master\node_modules\vm2\lib\main.js:214
throw this._internal.Decontextify.value(e);
^
ReferenceError: $gwx is not defined
at vm.js:3:3
at Script.runInContext (vm.js:107:20)
at VM.run (C:\nodejs\wxappUnpacker-master\node_modules\vm2\lib\main.js:208:7
2)
at runVM (C:\nodejs\wxappUnpacker-master\wuWxss.js:68:124)
at runOnce (C:\nodejs\wxappUnpacker-master\wuWxss.js:85:27)
at Array.preRun (C:\nodejs\wxappUnpacker-master\wuWxss.js:165:5)
at CntEvent.decount (C:\nodejs\wxappUnpacker-master\wuLib.js:17:43)
at ioLimit.runWithCb (C:\nodejs\wxappUnpacker-master\wuLib.js:81:11)
at agent (C:\nodejs\wxappUnpacker-master\wuLib.js:54:14)
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_conte
xt.js:53:3)

@honhole

This comment has been minimized.

Copy link
Author

commented Jan 9, 2019

版本 v0.5vv_20181221

@daigang666

This comment has been minimized.

Copy link

commented Jan 9, 2019

报错信息如下 ,麻烦帮我看一下 ,谢谢

C:\nodejs\wxappUnpacker-master\node_modules\vm2\lib\main.js:214
throw this._internal.Decontextify.value(e);
^
ReferenceError: $gwx is not defined
at vm.js:3:3
at Script.runInContext (vm.js:107:20)
at VM.run (C:\nodejs\wxappUnpacker-master\node_modules\vm2\lib\main.js:208:7
2)
at runVM (C:\nodejs\wxappUnpacker-master\wuWxss.js:68:124)
at runOnce (C:\nodejs\wxappUnpacker-master\wuWxss.js:85:27)
at Array.preRun (C:\nodejs\wxappUnpacker-master\wuWxss.js:165:5)
at CntEvent.decount (C:\nodejs\wxappUnpacker-master\wuLib.js:17:43)
at ioLimit.runWithCb (C:\nodejs\wxappUnpacker-master\wuLib.js:81:11)
at agent (C:\nodejs\wxappUnpacker-master\wuLib.js:54:14)
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_conte
xt.js:53:3)

好巧,我刚刚也碰到了。。

@honhole

This comment has been minimized.

Copy link
Author

commented Jan 9, 2019

好巧,我刚刚也碰到了。。

。。。。。我还以为大神回复我了。。。。你解决了吗??

@daigang666

This comment has been minimized.

Copy link

commented Jan 10, 2019

好巧,我刚刚也碰到了。。

。。。。。我还以为大神回复我了。。。。你解决了吗??

没有。。。你把源码上传一下他看到了好分析一下

@1607056557

This comment has been minimized.

Copy link

commented Jan 10, 2019

F:\wxappUnpacker\node_modules\vm2\lib\main.js:214
throw this._internal.Decontextify.value(e);
^
ReferenceError: $gwx is not defined
at vm.js:3:3
at Script.runInContext (vm.js:107:20)
at VM.run (F:\wxappUnpacker\node_modules\vm2\lib\main.js:208:72)
at runVM (F:\wxappUnpacker\wuWxss.js:69:6)
at runOnce (F:\wxappUnpacker\wuWxss.js:86:27)
at Array.preRun (F:\wxappUnpacker\wuWxss.js:166:5)
at CntEvent.decount (F:\wxappUnpacker\wuLib.js:17:43)
at ioLimit.runWithCb (F:\wxappUnpacker\wuLib.js:81:11)
at agent (F:\wxappUnpacker\wuLib.js:54:14)
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
_979061065_3.zip

@Shawn2046

This comment has been minimized.

Copy link

commented Jan 11, 2019

我也遇到这个问题了,请问有大神解决了吗?

@gaohongwei0501

This comment has been minimized.

Copy link

commented Jan 11, 2019

你们都解决了吗?我也遇到了同样的问题,10个小程序,9个遇到了这个问题,1个没问题,什么情况?

@shuaimoumou

This comment has been minimized.

Copy link

commented Jan 14, 2019

大神们解决了没?$gwx is not defined

@wangheng669

This comment has been minimized.

Copy link

commented Jan 14, 2019

这个问题可以终结了,之前就说过低版本不会管的,你们可以看一下小程序的版本号是不是太低了

@1607056557

This comment has been minimized.

Copy link

commented Jan 14, 2019

这个问题可以终结了,之前就说过低版本不会管的,你们可以看一下小程序的版本号是不是太低了

前几天还正常反解码WXSS文件,几天之后重新解一次就不行了。

@shuaimoumou

This comment has been minimized.

Copy link

commented Jan 14, 2019

这个问题可以终结了,之前就说过低版本不会管的,你们可以看一下小程序的版本号是不是太低了

你说的版本是指小程序的版本?我解码的都是类似于摩拜单车,王者荣耀排行榜、携程之类的 都报错 都是版本低么?

@wangheng669

This comment has been minimized.

Copy link

commented Jan 14, 2019

这个问题可以终结了,之前就说过低版本不会管的,你们可以看一下小程序的版本号是不是太低了

你说的版本是指小程序的版本?我解码的都是类似于摩拜单车,王者荣耀排行榜、携程之类的 都报错 都是版本低么?

那就有可能是作者需要更新了

@lishouqiang

This comment has been minimized.

Copy link

commented Jan 30, 2019

这个问题看这里 2019最新的小程序反编译工具和方法 https://www.jianshu.com/p/53e97423383e

@7423385

This comment has been minimized.

Copy link

commented Feb 18, 2019

报错信息如下 ,麻烦帮我看一下 ,谢谢

C:\nodejs\wxappUnpacker-master\node_modules\vm2\lib\main.js:214
throw this._internal.Decontextify.value(e);
^
ReferenceError: $gwx is not defined
at vm.js:3:3
at Script.runInContext (vm.js:107:20)
at VM.run (C:\nodejs\wxappUnpacker-master\node_modules\vm2\lib\main.js:208:7
2)
at runVM (C:\nodejs\wxappUnpacker-master\wuWxss.js:68:124)
at runOnce (C:\nodejs\wxappUnpacker-master\wuWxss.js:85:27)
at Array.preRun (C:\nodejs\wxappUnpacker-master\wuWxss.js:165:5)
at CntEvent.decount (C:\nodejs\wxappUnpacker-master\wuLib.js:17:43)
at ioLimit.runWithCb (C:\nodejs\wxappUnpacker-master\wuLib.js:81:11)
at agent (C:\nodejs\wxappUnpacker-master\wuLib.js:54:14)
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_conte
xt.js:53:3)

解包出现各种问题可以联系我的QQ7423385,可以帮忙解决

@7423385

This comment has been minimized.

Copy link

commented Feb 18, 2019

这个问题可以终结了,之前就说过低版本不会管的,你们可以看一下小程序的版本号是不是太低了

你说的版本是指小程序的版本?我解码的都是类似于摩拜单车,王者荣耀排行榜、携程之类的 都报错 都是版本低么?

那就有可能是作者需要更新了

解包出现各种问题可以联系我的QQ7423385,可以帮忙解决

@7423385

This comment has been minimized.

Copy link

commented Feb 18, 2019

我也遇到这个问题了,请问有大神解决了吗?

解包出现各种问题可以联系我的QQ7423385,可以帮忙解决

@7423385

This comment has been minimized.

Copy link

commented Feb 18, 2019

好巧,我刚刚也碰到了。。

。。。。。我还以为大神回复我了。。。。你解决了吗??

解包出现各种问题可以联系我的QQ7423385,可以帮忙解决

@7423385

This comment has been minimized.

Copy link

commented Feb 18, 2019

解包出现各种问题可以联系我的QQ7423385,可以帮忙解决

@Water-spreading-time

This comment has been minimized.

Copy link

commented Mar 15, 2019

同样的问题,已解决。解决方法:将源代码function runVM(name,code){
let wxAppCode={},handle={cssFile:name};
let vm=new VM({sandbox:Object.assign(new GwxCfg(),{wxAppCode:wxAppCode,setCssToHead:cssRebuild.bind(handle)})});
vm.run(code);
for(let name in wxAppCode)if(name.endsWith(".wxss")){
handle.cssFile=path.resolve(frameName,"..",name);
wxAppCodename;
}
}
修改为:
function runVM(name,code){
let wxAppCode={},handle={cssFile:name};
let gg = new GwxCfg();
let tsandbox ={$gwx:GwxCfg.prototype["$gwx"],mainPageFrameReady:GwxCfg.prototype["$gwx"],wxAppCode:wxAppCode,setCssToHead:cssRebuild.bind(handle)};
let vm = new VM({sandbox:tsandbox});
vm.run(code);
for(let name in wxAppCode)if(name.endsWith(".wxss")){
handle.cssFile=path.resolve(frameName,"..",name);
wxAppCodename;
}
}

原文链接:https://www.yuchunlai.com/index.php/archives/33/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.