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

React native > 0.54 crashes with stream-js #201

Closed
abeltje1 opened this issue Sep 28, 2018 · 3 comments
Closed

React native > 0.54 crashes with stream-js #201

abeltje1 opened this issue Sep 28, 2018 · 3 comments

Comments

@abeltje1
Copy link

--
Getstream version: 3.16
React native: 0.54.4

Hi!

After updating RN from 0.53 to 0.54 getstream breaks. You can see the full error in the attached screenshot. When I remove the import to getstream, the error is gone.
The root of the issue (look here for a detailed explanation: facebook/react-native#18179) is that changes in Metro bundler cause errors when importing modules in two different ways

example: import {y} from './x' and import {z} from 'myapp/x'.

As per the stacktrace in the screenshot, you can see that line 4 of signing.js is throwing the error. Line 4 imports a Base64 library (https://github.com/davidchambers/Base64.js#reaIdme) and so it seems that library is causing the actual problems. It also looks like a kinda stale lib (last commit 1.5 year ago) so maybe it'd be a generally good idea to switch to a more actively maintained lib.

This is quite an annoying issue, for it's impossible to update RN now (and with RN that's important because of the relative instability of the framework). I'd appreciate it very much if someone could take a look.

I understand it's very annoying that Metro has such breaking updates (I've been frustrated by it many times) and it's not really a bug on your side, but I simply can't work around it, which is why I came here.

Thanks in advance!

Abel

@JelteF
Copy link
Contributor

JelteF commented Sep 28, 2018

Could you try reproducing this with the latest version of stream-js (v3.21.0)? I'm quite sure that will work for you, since we've actually created react native components recently to integrated easily with Stream. In case you're interested in them, here's some links:

@abeltje1
Copy link
Author

Hi!

First of all: sorry for the late reply. Thanks for your reply! I've tried updating to 3.21.0, but it didn't matter (issue was still there). Then I noticed that your components were using RN 0.55, so I decided to update my RN from 0.54 to 0.55 and the problem disappeared.

So for anyone who might experience this issue: don't use RN 0.54 with stream-js, just use > 0.54 or < 0.54.

@JelteF
Copy link
Contributor

JelteF commented Oct 11, 2018

No problem. Good to hear that you worked around it by using a newer version of react native :)

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

No branches or pull requests

2 participants