Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Issue with using this with react native #17

Open
Nandez89 opened this issue Jan 22, 2018 · 3 comments
Open

Issue with using this with react native #17

Nandez89 opened this issue Jan 22, 2018 · 3 comments

Comments

@Nandez89
Copy link

Hello,

I was wondering if this is compatible with React Native or if you can point me in the right direction.
Trying to use the lib... I installed it using the npm command but I get the following error when I try to run my app. Every time I include the line:

var chatbase = require('@google/chatbase')

I get this error, so I haven't been able to use the lib

Bundling `index.js`  [development, non-minified]  22.3% (123/1345), failed.
error: bundling failed: UnableToResolveError: Unable to resolve module `events` from `/user/helloproject/node_modules/@google/chatbase/node_modules/got/index.js`: Module does not exist in the module map

Could you help me get some direction on how to address this

@cristiancavalli
Copy link
Contributor

Hmm, @Nandez89 I haven't used this with react native but it looks like it is failing to import the events module for Node.js for the Got library which looks like it's being imported here: https://github.com/sindresorhus/got/blob/master/index.js#L2

Seems to be a known issue:
facebook/react-native#11498

With specifics about the events module here:
Leonidas-from-XIV/node-xml2js#363

Please lmk if that isn't helpful

@Nandez89
Copy link
Author

@cristiancavalli Thanks for the fast reply, I have tried the workaround suggested in your references and still get the same error.

I was wondering if maybe the chatbase-node is not intended to work for react native or needs some adjustments to make it compatible. if it's not compatible then I'd rather not spend much time stuck in this until there's a solution.

@cristiancavalli
Copy link
Contributor

Hey @Nandez89 --

Sorry that didn't work out. There's nothing we've put into the module (that we know of) that conflicts directly with React native. The error, also, seems to be coming from a dependent library (Got) and everything that I have seen so far does not indicate that Got shouldn't work with react native. I'll keep looking into it and try to help in any way I can. Please ping this thread if you find anything on your end.

Cheers,
Cris

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

No branches or pull requests

2 participants