Asana/node-asana

React-native

niallel opened this issue · 2 comments

Hi,

I saw a previous issue #213 where there was an example about the library working on react-native.

I've tried the example (using expo) and also with npx react-native init but get a lot of unsolved modules.
For example:

Unable to resolve module util from AwesomeProject/node_modules/asana/lib/errors/forbidden.js: util could not be found within the project.

Any ideas? Or is it best not to use this module for the API from a client?

thanks,

niall

Hello @niallel !

The normal fix to that is npm install within the folder to pull down all of the modules.

Assuming you've done that, if following the tutorial in #213 didn't work for you, I'm guessing it's because your node version is different than what I'm using or react-native has changed significantly since I wrote that.

I'm on Node v10.15.1

Sadly, I can't see that error locally so I don't think I'll be much help.

Alternatively, you can hit our API with any HTTPS library. Instead of using asana.tasks.getTasks, you'll be hitting the endpoints manually: GET https://app.asana.com/api/1.0/tasks. Either way, our docs should help https://developers.asana.com/docs/get-multiple-tasks

Thanks for the quick reply. Unfortunately running npm install in the node_modules/asana directory didn't work.
It seemed to get further though, but now fails on finding the fs module, which is obviously a build in node module and not in react-native.

I'll use the http api instead.

Thanks again,