christopherdro / react-native-html-to-pdf

Convert html strings to PDF documents using React Native
MIT License
434 stars 264 forks source link

Cannot read property 'convert' of undefined on web platform #204

Closed EricRajoelison closed 3 years ago

EricRajoelison commented 3 years ago

When I build the application on web platform, it shows me : Unhandled Rejection (TypeError): Cannot read property 'convert' of undefined

Although, on Android it works perfectly. Here is my code:

let options = {
        html: createHTML(),
        fileName: 'test',
        directory: 'Documents',
    };

    let file = await RNHTMLtoPDF.convert(options)
     alert(file.filePath);

Any idea? Thank you in advance.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

melero2000 commented 3 years ago

Same error here. Did you get it fixed? @EricRajoelison

melero2000 commented 3 years ago

Same error here. Did you get it fixed? @EricRajoelison

Use --save when installing it. This is how it worked for me