React Native: buffer is not defined

I tried to use "azure-mobile-apps-client" npm package in a React Native app, and it throws error "buffer is not defined" in Simulator.

I searched around in google.com, and found out below solution:

global.Buffer = global.Buffer || require('buffer').Buffer;
var WindowsAzure=require('azure-mobile-apps-client');
I added above code to the .js file, and run it again. Done! the issue is gone and I can get the Azure Mobile App Service Client object which can be seen in the debug code in Chrome.   
 Run "npm i", and then run the app successfully. :)


Further Study

 
 

I had been studied the online course "The Complete React Native and Redux Course", it gave me the clear explanation and instruction with step by step procedures to learn the core knowledge to build React components for mobile devices. It's suitable for all levels. The course has sample code and completed projects in gitHub.com.

Instructor: Stephen Grider -  Engineering Architect, Stephen Grider has been building complex Javascript front ends for top corporations in the San Francisco Bay Area.


Comments

  1. Hey! This is my first visit to your blog! We are
    a collection of volunteers and starting
    a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job!

    React Native Development Company
    Reactjs Development Company Texas

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Read your blog and I believe this is really a nice blog. One can easily understand about the react native with the help of this blog. I was looking to hire react native app developer and got your blog. Thanks for sharing such a nice blog.
    Synsoft Global

    ReplyDelete
  4. Hi.
    Grat article with excellent content.
    Thank you for sharing this awesome blog,keep updating...

    Power BI Course

    ReplyDelete

Post a Comment

Popular posts from this blog

Top JavaScript courses helping you develop SPFx webPart with ReactJS and AngularJS

SharePoint 2013 error - "Application error when access /_vti_bin/client.svc"

Enable the Microsoft Power BI report file type (.pbix) in SharePoint Search