-
Notifications
You must be signed in to change notification settings - Fork 115
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
utf8.decode() is not a function error #17
Comments
What have you tried exactly? What happens exactly? |
We imported the package: var utf8 = require('utf8'); then invoked the decode method on a string bytes from a base64 string (or any input) with utf8.decode(input) i get the error. utf8.encode(input) works fine. |
Please provide a reduced test case so I can reproduce the error. |
Unhandled JS Exception: utf8.decode is not a function. (In 'utf8.decode(bytes)', 'utf8.decode' is undefined) |
It’s hard to figure out what you’re doing exactly, unless you tell me. It works fine for me:
Since there appears to be no issue with utf8.js, I am closing this issue. Provide a reduced test case and I’ll take a look. |
React Native problem? I'm getting the same error as this chap. https://stackoverflow.com/questions/41252188/react-native-how-to-decode-base64-encoded-string |
@mathiasbynens the simplified test case is
then open
then start the app using
then open the developer panel (⌘+D) and select "Debug JS Remotely" |
Looks like Facebook has a utility that takes precedence over this one when you do an |
@davidaurelio Got any suggestions for what to do about this? |
@mathiasbynens Maybe consider also publishing this under |
@mcmar can you send a PR for React Native to rename the internal module to something different? |
See mathiasbynens#17 for more details
well, I solved this error not using this project but the old method:
|
This makes it possible for developers to use the `utf8` package from npm in combination with React Native. Ref. mathiasbynens/utf8.js#17
This makes it possible for developers to use the `utf8` package from npm in combination with React Native. Ref. mathiasbynens/utf8.js#17
It was not used anyway. Furthermore, removing it makes it possible for developers to use the `utf8` package from npm in combination with React Native. Ref. mathiasbynens/utf8.js#17 Update __utf8.js
It was not used anyway. Furthermore, removing it makes it possible for developers to use the `utf8` package from npm in combination with React Native. Ref. mathiasbynens/utf8.js#17 Update __utf8.js
It was not used anyway. Furthermore, removing it makes it possible for developers to use the `utf8` package from npm in combination with React Native. Ref. mathiasbynens/utf8.js#17 Update __utf8.js
Summary: As requested by davidaurelio in mathiasbynens/utf8.js#17 (comment), this makes it possible for developers to use the `utf8` package from npm in combination with React Native. Ref. mathiasbynens/utf8.js#17 Closes #17146 Differential Revision: D6765030 Pulled By: hramos fbshipit-source-id: dda9b3255618470aea2e32c5ba3cf1325e2ec997
Hi,
We've followed your instructions in the repo but cannot call the decode method. Encode works fine. Any insights as to why this might happen?
Thank you
The text was updated successfully, but these errors were encountered: