【发布时间】:2015-08-25 15:54:20
【问题描述】:
对于我的(第一个)react-native 项目,我使用 Node 模块 react-native-refreshable-listview 需要 CommonJS/A+ 承诺方法来显示指标。但是,每次消费者调用 promise 的 then 方法(例如 this.doSomething().then(function() { ... }))时,我都会收到以下错误:
Error: Can't find variable: process
stack:
requestFlush index.ios.bundle:43767
rawAsap index.ios.bundle:43709
handle index.ios.bundle:43602
finale index.ios.bundle:43661
resolve index.ios.bundle:43651
<unknown> index.ios.bundle:43683
<unknown> index.ios.bundle:42446
notifyAll index.ios.bundle:4880
close index.ios.bundle:4597
closeAll index.ios.bundle:6174
perform index.ios.bundle:6115
perform index.ios.bundle:4629
flushBatchedUpdates index.ios.bundle:4709
ReactUpdates_flushBatchedUpdates index.ios.bundle:4978
closeAll index.ios.bundle:6174
perform index.ios.bundle:6115
batchedUpdates index.ios.bundle:13822
batchedUpdates index.ios.bundle:4644
<unknown> index.ios.bundle:7567
applyWithErrorReporter index.ios.bundle:7314
guardReturn index.ios.bundle:7336
processBatch index.ios.bundle:7566
URL: http://192.168.16.250:8081/index.ios.bundle
line: 43767
message: Can't find variable: process
我已经阅读了this question,但我无法解决这个问题。
虽然 ControlledListView 组件可以用来规避这个错误,但我非常喜欢 promise 的概念,我打算在我的应用程序中使用更多。
我正在使用 react-native 版本 0.6.0 rc1 以及 iOS 8.3。
感谢您的帮助。提前致谢!
【问题讨论】:
-
你在使用 Promise 库吗?哪一个?
-
是的,我使用this website建议的库
promise(NodeJS部分)
标签: javascript promise react-native es6-promise