-
Notifications
You must be signed in to change notification settings - Fork 37
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
[BUG] Error in React Native project after the update to 3.0.0 #232
Comments
We're testing this under internal ticket FSSDK-10089 this week. |
We're still seeing this as a problem in React Native projects... More research needed... |
Also reported by optimizely/javascript-sdk#925 |
@mlazari you are right. |
@junaed-optimizely Thank you, good to know 0.74 supports it. For now I ended up using fast-text-encoding. text-encoding-polyfill also was working when I tried it, as I mentioned in the description. |
Closing this, as we have added better support for React Native in v3.1.2 onward. And here is the detailed doc for integration. React Native installation guide |
Is there an existing issue for this?
SDK Version
3.0.0
Current Behavior
Error:
Expected Behavior
No errors.
Steps To Reproduce
Version 3.0.0 updated @optimizely/optimizely-sdk from 4.9.1 to 5.0.0 (2.9.2...3.0.0#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L33), that updated murmurhash to 2.0.1 and that replaced Buffer with TextEncoder (https://github.com/perezd/node-murmurhash/releases/tag/2.0.1). The problem is that TextEncoder doesn't seem to be defined in ReactNative environment (maybe just when using hermes engine?) so it throws errors like this:
I found this in another repo - paralleldrive/cuid2#41 - which seems to be addressed here by adding instructions to the README - paralleldrive/cuid2@21da5b4. Should this library also have that documented maybe? I tried adding those polyfills and both of them fix the issue.
React Framework
No response
Browsers impacted
No response
Link
No response
Logs
No response
Severity
No response
Workaround/Solution
Use either
fast-text-encoding
ortext-encoding-polyfill
TextEncoder polyfill as mentioned in paralleldrive/cuid2@21da5b4Recent Change
No response
Conflicts
No response
The text was updated successfully, but these errors were encountered: