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-state-tree的flow使用问题 #1847

Closed
blooddrunk opened this issue Jan 7, 2019 · 3 comments
Closed

mobx-state-tree的flow使用问题 #1847

blooddrunk opened this issue Jan 7, 2019 · 3 comments

Comments

@blooddrunk
Copy link

使用mobx-state-tree进行异步操作时(小程序端)有如下错误:

mobx-state-tree.js:2910 Uncaught (in promise) ReferenceError: setImmediate is not defined
    at next (mobx-state-tree.js:2910)
    at onFulfilled (mobx-state-tree.js:2886)
    at <anonymous>

https://github.com/mobxjs/mobx-state-tree/blob/02ded32c8bfa70e13091ed3967466c6a0d6493ee/packages/mobx-state-tree/src/core/flow.ts#L138

请问如何为setImmediate添加polyfill,直接在入口文件中import似乎无效。

@taro-bot
Copy link

taro-bot bot commented Jan 7, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@luckyadam
Copy link
Member

你是怎么加 polyfill 的

@blooddrunk
Copy link
Author

blooddrunk commented Jan 8, 2019

类似@tarojs/async-wait 加个setImmediate 方法, 在入口文件引入。 另外试了下配置文件babel plugins添加 babel-plugin-transform-runtime 也不行

qq20190108-160436 2x

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

4 participants