question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The example's Simple Share Image Base 64 issues fails (undefined is not a function)

See original GitHub issue

Steps to reproduce

  1. Install the example on android
  2. Click on ‘Simple Share Image Base 64’

Environment

  • React Native version: 0.58.4
  • React Native platform + platform version: android 7.1

react-native-share

Version: ^1.1.3

Actual behaviour

I get the following error:


undefined is not a function (evaluating 'Object.keys(styles)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"]()')
assembleStyles
    index.delta?platform=android&dev=true&minify=false:24797:114
createCommonjsModule
    index.delta?platform=android&dev=true&minify=false:23490:44
<unknown>
    index.delta?platform=android&dev=true&minify=false:24719:42
<unknown>
    index.delta?platform=android&dev=true&minify=false:23483:75
<unknown>
    index.delta?platform=android&dev=true&minify=false:23484:5
loadModuleImplementation
    index.delta?platform=android&dev=true&minify=false:265:14
guardedLoadModule
    index.delta?platform=android&dev=true&minify=false:153:47
metroRequire
    index.delta?platform=android&dev=true&minify=false:88:92
onUnhandled
    index.delta?platform=android&dev=true&minify=false:23029:32
onUnhandled
    index.delta?platform=android&dev=true&minify=false:23445:30
<unknown>
    index.delta?platform=android&dev=true&minify=false:26651:26
_callTimer
    index.delta?platform=android&dev=true&minify=false:26568:17
callTimers
    index.delta?platform=android&dev=true&minify=false:26775:19
__callFunction
    index.delta?platform=android&dev=true&minify=false:2481:49
<unknown>
    index.delta?platform=android&dev=true&minify=false:2238:31
__guard
    index.delta?platform=android&dev=true&minify=false:2435:15
callFunctionReturnFlushedQueue
    index.delta?platform=android&dev=true&minify=false:2237:21

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mironiastycommented, Feb 18, 2019

I had similar issue in my code. Turns out that it is bug(?) in RN 0.58. I was getting warning from rn-share but it could not be displayed correctly.

You can open node_modules/react-native/Libraries/Promise.js and replace:

message = require('pretty-format')(error);

with just:

message = error; // or message = error.error;

you will then get proper error from react-native-share that will tell you what is wrong.

1reaction
rahamin1commented, Feb 25, 2019

The solution in my case (android) was to perform manual installation (https://github.com/react-native-community/react-native-share#Android-Install) instead of react-native link react-native-share

Read more comments on GitHub >

github_iconTop Results From Across the Web

The example's Simple Share Image Base 64 issues fails ...
I was getting warning from rn-share but it could not be displayed correctly. You can open node_modules/react-native/Libraries/Promise.js and ...
Read more >
JavaScript Problems — Image to Base64 String, Undefined vs ...
We've to call the function that's expected to throw an except within a function so that Jasmine can call it and check if...
Read more >
Error getting image with "image-to-base-64" in react
The main issue here though, is with the image URL you are trying to request. The image URL at "via.placeholder.com/125/000000/FF0000?text=place+ ...
Read more >
btoa() - Web APIs - MDN Web Docs - Mozilla
The btoa() method creates a Base64-encoded ASCII string from a binary string (i.e., a string in which each character in the string is ......
Read more >
How Base64 encoding and decoding is done in node.js
Encoding the original string to base64: The Buffer class in Node.js can be used to convert a string to a series of bytes....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found