react-native-pdf: ReferenceError: url is not defined RN 0.57.8

What react-native version are you using? 0.57.8

What react-native-pdf version are you using? 5.0.9

What platform does your issue occur on? (android/ios/both) iOS

Describe your issue as precisely as possible :

I have just upgraded to react native 0.57.8 from 0.57.4 and now when I try to open a pdf I am getting the error: ‘ReferenceError: url is not defined’. This happens with multiple source uris including uris to dummy pdf files as a test, plus I have tested all the uris on web and they work fine.

I noticed that this was a closed issue previously and am wondering if it has somehow come back with the latest RN version?

Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

      <View style={styles.pdf}>
        <Pdf
          onLoadComplete={this.onPdfLoadComplete}
          source={{uri: `${uri}`}}
          onError={this.onPdfLoadError}
          style={styles.pdf}
        />
      </View>

dependency versions: “react”: “^16.6.3” “react-native”: “0.57.8” “react-native-pdf”: “^5.0.9” “react-native-share”: “^1.1.3” “rn-fetch-blob”: “^0.10.13”

screenshot 2018-12-14 at 15 10 49

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

everyone, can you use “rn-fetch-blob”: “0.10.13” test again?

Not working for me with: react-native: 0.55.4; react-native-pdf: 5.0.6; rn-fetch-blob: 0.10.13;

@loikfb I was using ‘^0.10.13’ so would have actually be using 0.10.14. When i fixed it to ‘0.10.13’ it then worked 👍

Not working for me, @LydGol90 I don’t understand how ? You where already on rn-fetch-blob 0.10.13 at the time you’ve open the issue.