danomatic / react-pdf-html

Render HTML in react-pdf
MIT License
172 stars 40 forks source link

Cannot read properties of undefined (reading 'create') #78

Closed tbrandle closed 8 months ago

tbrandle commented 9 months ago

I'm running into an error in the browser complaining about the StyleSheet.create method in createHtmlStylesheet.

Here are my versions:

    "@react-pdf/renderer": "^3.1.17",
    "@types/react": "^18.2.55",
    "react-pdf-html": "1.1.22",

Any help would be appreciated!

jpblopez commented 9 months ago

Im having the same problem here. I tried editing the code inside the package itself but no luck. My versions:

node -v
v16.18.1

package.json

    "@react-pdf/renderer": "^3.3.8",
    "react": "^18.2.0",
    "react-pdf-html": "^1.2.0"
mikolajmigacz commented 9 months ago

Hi!

I encountered the same issue, and I was able to solve it by downgrading @react-pdf/renderer to version 3.1.14 and react-pdf-html to 1.1.22.

danomatic commented 8 months ago

Has anyone found a root cause for this? the @react-pdf/renderer docs still seem to reference StyleSheet.create: https://react-pdf.org/styling

danomatic commented 8 months ago

I'm going to consider this closed and a react-pdf issue until I hear otherwise