Open koranra opened 8 months ago
The same problem with React 18.2 and Node v20.10
@andrey-prokhorov it works for me if I upgrade to react 18 with node 21. But my app is on React 16.14 and thats where its causing the issue.
I encounter the issue client side, packaging my app with Expo/Metro Bundler with the following error:
Unable to resolve "yoga-layout" from "node_modules/@react-pdf/layout/lib/index.cjs"
Node v21.6.2 React 18.2.0
@jgo80 @koranra @andrey-prokhorov @koranra
Add this in your package.json
"resolutions": { "@react-pdf/layout": "3.6.4", "@react-pdf/textkit": "4.3.0", "@react-pdf/image": "2.2.2", "@react-pdf/pdfkit": "3.1.2" }
I fixed by adding to my package.json:
"overrides": {
"@react-pdf/layout": "3.6.4",
"@react-pdf/textkit": "4.3.0",
"@react-pdf/image": "2.2.2",
"@react-pdf/pdfkit": "3.1.2"
},
Duplicate of #2499?
Describe the bug Trying to import the library and generate a PDF and am running into issues - Module not found: Can't resolve 'yoga-layout' with React 16.14.0 and Node 21
To Reproduce attached sample code with a simple example. I followed all the things mentioned in this thread - https://github.com/diegomura/react-pdf/issues/2499. It works when I use *renderer v3.1.14 and layout v3.6.3**, But it generates a empty pdf. So its breaking with that approach as well.
sample-app.zip
any help would be highly appreciated.