Process.nextTick is not a function (React native, ddp, meteor)

In response to native, I'm trying to use the "ddp-client" node library to connect to the meteor server. Once the connection is successful, I get the following client-side ERROR:

2016-01-17 16:14:15.992 [trace][tid:com.facebook.React.JavaScript] ddp message: {"msg":"connected","session":"PGLBqgvoeuXgBtke2"}
2016-01-17 16:14:16.007 [warn][tid:com.facebook.React.JavaScript] process.nextTick is not a function. (In 'process.nextTick(function(_this){
return function(){
return _this._flush();};}(

this))', 'process.nextTick' is undefined)
2016-01-17 16:14:16.008 [error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: process.nextTick is not a function. (In 'process.nextTick(function(_this){
return function(){
return _this._flush();};}(

this))', 'process.nextTick' is undefined)
+4
source share
1 answer

process.nextTickdoesn't exist in React Native, so we get a polyfill of it. It is as simple as that process.nextTick = setImmediate.

Example: https://github.com/spencercarli/meteor-todos-react-native/blob/master/ReactNativeTodos/app/config/db/lib/process.polyfill.js

You need to make sure that you do this in the component root file (e.g. index.ios.js)

Hope this helps you!

+6

Source: https://habr.com/ru/post/1624705/


All Articles