react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

SyntaxError: Cannot use import statement outside a module

Open opatricpires opened this issue 4 years ago • 4 comments

What react-native version are you using? 0.63.4

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

Describe your issue as precisely as possible : When I'm creating a simple snapshot testing using jest and react-native-testing-library an error occurs:

.../node_modules/react-native-pdf/index.js:10
    import React, {Component} from 'react';
    ^^^^^^

Show us the code you are using?

In my component file

      <PDF
        source={source}
        onError={error => {
          console.log(error)
        }}
      />

Obs: I'm using typescript.

opatricpires avatar Sep 30 '21 17:09 opatricpires

Any updates on this? I am stuck on this issue!

alphazhe avatar Jan 10 '22 10:01 alphazhe

Still no updates?

senkevichdv avatar Feb 04 '23 05:02 senkevichdv

No update guys, we removed the test to this component for now.

opatricpires avatar Mar 02 '23 13:03 opatricpires

@opatricpires This should be of help for this type of error https://stackoverflow.com/a/55803188

muiruri avatar Dec 05 '23 05:12 muiruri