weidian-inc / hera

A framework for running WeChat applet. (小程序 SDK,小程序转 H5,小程序转安卓、iOS 原生应用、小程序渲染引擎)
https://weidian-inc.github.io/hera
Other
1.48k stars 315 forks source link

编译成web时,wxml内嵌的wxs脚本转换报错了 #9

Open AbooJan opened 6 years ago

AbooJan commented 6 years ago

错误信息

Error parsing statement => location.name(singler.location) <=  Unknown Type: CallExpression{ Error parsing statement => location.name(singler.location) <= : Unknown Type: CallExpression
    at walk (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:6095)
    at walk (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:4201)
    at walk (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:4141)
    at walk (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:4005)
    at walkExp (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:6204)
    at parseExp (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:6400)
    at parseText (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:3701)
    at Object.chars (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:18629)
    at parseHTML (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:16164)
    at parse$1 (/usr/local/lib/node_modules/hera-cli/node_modules/wxml-transpiler/build.js:1:16891)
  name: 'Error parsing statement => location.name(singler.location) <= ' }

When Parsing: ./pages/home/home.wxml
=====v=====
Error executing: node /usr/local/lib/node_modules/hera-cli/node_modules/weweb-cli/bin/weweb /Users/aboo/Downloads/HERA/src -b -d heraTmp/web
=====^=====
(node:7501) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: child process exited with code 1
(node:7501) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

这是wxml内嵌的wxs, location是字符串类型

<wxs module="location">
    var showName = function(location) {
        var places = location.split("/");
        var showName = places[0] + " " + places[1];
        return showName;
    }
    module.exports = {
        name: showName,
    }
</wxs>

不知道是不是不支持wxs的转换

IOriens commented 6 years ago

抱歉,现在还不支持 wxs 的转换,我们会尽快加上

anzhen9 commented 5 years ago

一年了。。。。这项目废了?