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

微信小程序转taro h5 无法运行 #1424

Closed
mienv567 opened this issue Dec 9, 2018 · 11 comments
Closed

微信小程序转taro h5 无法运行 #1424

mienv567 opened this issue Dec 9, 2018 · 11 comments

Comments

@mienv567
Copy link

mienv567 commented Dec 9, 2018

小程序正常截图
qq 20181209182608

h5截图
taro-h5

index.js?e6ae:50 Uncaught (in promise) TypeError: Super expression must either be null or a function at _inherits (index.js?e6ae:50) at eval (index.js?e6ae:833) at createWrappedComponent (index.js?e6ae:974) at eval (index.js?e6ae:1030) index.js?5063:7 Uncaught (in promise) TypeError: _taroH2.default.getApp is not a function at eval (index.js?5063:7) at Object../.temp/pages/myQuestion/index.js (myQuestion_index.js:11) at __webpack_require__ (app.js:768) at fn (app.js:131) at fn.t (app.js:175)
微信原生小程序转taro后,taro转小程序可以运行,h5不行。

@taro-bot
Copy link

taro-bot bot commented Dec 9, 2018

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@luckyadam
Copy link
Member

把报错贴出来

@mienv567
Copy link
Author

mienv567 commented Dec 9, 2018

把报错贴出来
已经从新上传错误。

@luckyadam
Copy link
Member

image
点进去看下呢

@mienv567
Copy link
Author

mienv567 commented Dec 9, 2018

image
点进去看下呢

function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
第50行: throw new TypeError("Super expression must either be null or a function");
}

@yuche yuche changed the title 微信小程序转taro是不是还没有完善 微信小程序转taro h5 无法运行 Dec 9, 2018
@mienv567
Copy link
Author

mienv567 commented Dec 9, 2018

继续测试转换平台
1.微信转换成功运行
2.百度转换成功运行,转换过程中以下错误但不影响使用
错误 压缩错误 文件F:\Git\astro\wenda\taroConvert\node_modules\@tarojs\with-wea pp\dist\index.js { SyntaxError: Unexpected token: punc ()) at JS_Parse_Error.get (eval at <anonymous> (F:\Git\astro\wenda\taroConvert\n ode_modules\uglify-js\tools\node.js:20:1), <anonymous>:71:23) at formatError (internal/util/inspect.js:775:16) at formatRaw (internal/util/inspect.js:573:14) at formatValue (internal/util/inspect.js:471:10) at inspect (internal/util/inspect.js:193:10) at Object.formatWithOptions (util.js:85:12) at Console.(anonymous function) (console.js:188:15) at Console.log (console.js:199:31) at recursiveRequire (C:\Users\Administrator\AppData\Roaming\npm\node_modules \@tarojs\cli\src\util\resolve_npm_files.js:214:19) at CallExpression (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@ tarojs\cli\src\util\resolve_npm_files.js:143:21) message: 'Unexpected token: punc ())', filename: '0', line: 3045, col: 10, pos: 82300 }
qq 20181209233414
3. 转换react-native 6个页面不成功样式不支持。

4.我感觉转换成小程序都能运行两款已经成功,是不是 es5 es6 语法问题。

@luckyadam
Copy link
Member

你用的哪个版本转的

@mienv567
Copy link
Author

你用的哪个版本转的

taro 1.2 beta 11,我昨天以为linux下有问题,我就在自己win电脑下安装了最新版.,和linux下一样,会出现以上错误
TypeError: _taroH2.default.getApp
写法:var e = Taro.getApp()
还有这个错误其它就没有啦
TypeError: Super expression must either be null or a

@luckyadam
Copy link
Member

@mienv567 Taro.getApp() 在 H5 里还没有实现,你可以换种写法,另外那个报错,你得自己定位下问题

@mienv567
Copy link
Author

@mienv567 Taro.getApp() 在 H5 里还没有实现,你可以换种写法,另外那个报错,你得自己定位下问题

我不用h5可以,我想用react-native,目前有没有完美的处理pages下的转换方法除css外,我一会儿贴出react转换个别页面转换中出错的地方.

@mienv567
Copy link
Author

@mienv567 Taro.getApp() 在 H5 里还没有实现,你可以换种写法,另外那个报错,你得自己定位下问题

嗯,react-native 我也发现是wxml代码的问题,标签括号花括号排序问题,这是经过convert转换后的代码。可能自己在写wxml排列的问题吧
xo1ds h 0877k y q bnn o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants