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

mobx编译h5报错, 1.3.6和之后的版本, 1.3.5是正常的 #4002

Closed
magicbing opened this issue Jul 29, 2019 · 1 comment
Closed

mobx编译h5报错, 1.3.6和之后的版本, 1.3.5是正常的 #4002

magicbing opened this issue Jul 29, 2019 · 1 comment

Comments

@magicbing
Copy link

问题描述
在taro1.3.10版本,
mobx会报错
把package.json的mobx-h5降到1.3.5就不报了, (1.3.6-1.3.10会报错)
但是旧版本用不了新的mobxhooks

浏览器控制台报错内容:
index.esm.js?130d:2473 Error: Please pass a valid component to 'observer'
at observer (index.esm.js?a262:234)
at eval (index.js?3db4:7)
at Module../.temp/pages/sdd/pagebase/index.js (rpwall_exchangedetail_indexrpwall_home_indexrpwall_inviteregister_indexrpwall_mine_indexrpwall_m~f63cc8f8.2b31a5be.js:23)
at webpack_require (app.dc714345.js:767)
at fn (app.dc714345.js:130)
at eval (index.js:11)
at Module../.temp/pages/sdd/home/index.js (sdd_home_index.0df02893.js:11)
at webpack_require (app.dc714345.js:767)
at fn (app.dc714345.js:130)

代码报错的地方:
@observer
@Inject('xxx')

nodejs报错内容:
⚠ Compiled with warnings.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 5:0-111
" '@tarojs/mobx-common' does not contain an export named 'PropTypes'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 221:13-22
" '@tarojs/mobx-common' does not contain an export named 'PropTypes'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 203:43-56
" '@tarojs/mobx-common' does not contain an export named 'getInjectName'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 5:0-111
" '@tarojs/mobx-common' does not contain an export named 'isUsingStaticRendering'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 228:26-48
" '@tarojs/mobx-common' does not contain an export named 'isUsingStaticRendering'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 217:9-30
" '@tarojs/mobx-common' does not contain an export named 'useAsObservableSource'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 213:9-22
" '@tarojs/mobx-common' does not contain an export named 'useLocalStore'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 5:0-111
" '@tarojs/mobx-common' does not contain an export named 'useStaticRendering'.

./node_modules/_@[email protected]@@tarojs/mobx-h5/dist/index.esm.js 229:22-40
" '@tarojs/mobx-common' does not contain an export named 'useStaticRendering'.

复现步骤
升级至1.3.6和以后的版本
运行npm run dev:h5

系统信息

👽 Taro v1.3.10

Taro CLI 1.3.10 environment info:
System:
OS: Windows 10
Binaries:
Node: 10.16.0 - E:\nodejs\node.EXE
npm: 6.9.0 - E:\nodejs\npm.CMD
补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

@taro-bot
Copy link

taro-bot bot commented Jul 29, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@magicbing magicbing changed the title mobx编译h5报错, mobx编译h5报错, 1.3.6和之后的版本, 1.3.5是正常的 Jul 29, 2019
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

2 participants