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

process.nextTick is not a function #20

Closed
yaibait opened this issue Aug 29, 2017 · 5 comments
Closed

process.nextTick is not a function #20

yaibait opened this issue Aug 29, 2017 · 5 comments

Comments

@yaibait
Copy link

yaibait commented Aug 29, 2017

I try import clarifai to my react native project , when I try

const ClarifaiApp = new Clarifai.App({
  apiKey: 'xxxx'
 });

ClarifaiApp.models.predict(Clarifai.GENERAL_MODEL, "https://samples.clarifai.com/metro-north.jpg").then(
      function(response) {
        // do something with response
        console.log(response);
      },
      function(err) {
        console.log(err);
        // there was an error
      }
    );
  }

I get error process.nextTick is not a function

@eddiezane
Copy link
Contributor

@yaibait it looks like React Native doesn't have a process.nextTick.

We'll look into a better solution for this but for now you can polyfill it with setImmediate

Add this somewhere near the top of your entrypoint:

process.nextTick = setImmediate

@yaibait
Copy link
Author

yaibait commented Aug 30, 2017

@eddiezane thanks you, it work for me

@yaibait yaibait closed this as completed Aug 30, 2017
@eddiezane
Copy link
Contributor

@yaibait glad to hear. Going to keep this open until we find a permanent fix.

@eddiezane eddiezane reopened this Aug 30, 2017
@eddiezane
Copy link
Contributor

From the research I've done it seems that polyfilling this is expected by the React Native developer.

Maybe in the future our build tools will avoid this issue entirely.

If anyone finding this issue in the future has any advice otherwise we're all ears!

@tetreault
Copy link

thanks @eddiezane - fixed the nextTick error on my end!

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

No branches or pull requests

3 participants