-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yoga-layout v2 leads to failing builds #2499
Comments
Describe the bug |
I am also experiencing similar issue in Jest when running my unit test on node 14.12.0.
I agree with OP Upgraded yoga to v2 and removed bundled package seems to be the issue. Adding overrides to @react-pdf/layout:3.6.4 (version before removing @react-pdf/yoga) to package.json temporarily resolves issue. Screenshot |
This issue is most likely due to using a very old node version (like 12 mentioned above) or old bundlers that do not support |
Any guys are using old node version like 12, needed to modify https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions |
While modifying |
This has to do with module resolution in yoga-layout. In Whatever tool you're using to bundle your code:
To resolve this, we would need to look at specific tool configuration where the bug is likely to be found. |
I have also got this issue 279.4 ERROR in ./node_modules/yoga-layout/src/generated/YGEnums.ts 10:7
|
I'm currently using an AWS cdk NodeJsFunction with Node 18 and no special props that leads to a failing
tmk: this uses |
Instead of putting it in the overrides, try adding @react-pdf/layout in the dependencies part of your package.json Also be sure to nuke you node_modules and package-lock after making those changes. |
when using renderer v3.1.14 and layout v3.6.3 it works but, the iframe it generates is left blank, therefore rendering is still not working with old versions. has anyone found fix for this issue? |
what's ur version node? |
Hello, any update on this issue ? |
Hello, any... REPRODUCIBLE EXAMPLES? 🙏😁 Can't get it breaking on my setup! |
any updates? |
If I have later or tomorrow enough time, I will create an example and upload it on GitHub. |
I have the same error on my project. If I rename this file, it works fine !!! Not really a fix but it may help to understand the problem |
You quick-start guide is reproducible example. After fresh project creation and adding react-pdf every project stop working |
Wich examples are you need? It broken from 'Starting with react-pdf is extremely simple.' - line of your documentation |
Before you guys updated it to the latest version I was using 3.3.4 and it was working fine, the only issue with that version was flickering of whole page when updating data using useState, now when I tried to reuse the same it showed error of module not found: yoga-layout. |
Getting this after installing react-pdf/renderer: ERROR in ./node_modules/yoga-layout/src/generated/YGEnums.ts 10:7
webpack 5.90.3 compiled with 1 error in 5575 ms |
Had this issue 2209 | return node;
2210 | };
2211 | };
2212 |
2213 | var OVERFLOW = {
2214 | hidden: Yoga__namespace.Overflow.Hidden,
^
TypeError: undefined is not an object (evaluating 'Yoga__namespace.Overflow.Hidden')
at /node_modules/.pnpm/@react-pdf+layout@3.11.2/node_modules/@react-pdf/layout/lib/index.cjs:2214:10
at globalThis (/node_modules/.pnpm/@react-pdf+layout@3.11.2/node_modules/@react-pdf/layout/lib/index.cjs:3876:18)
at overridableRequire (:1:20)
at /node_modules/.pnpm/react-pdf-html@1.2.0_@react-pdf+renderer@3.1.14_react@18.2.0/node_modules/react-pdf-html/node_modules/@react-pdf/renderer/lib/react-pdf.cjs.js:14:4
at globalThis (/node_modules/.pnpm/react-pdf-html@1.2.0_@react-pdf+renderer@3.1.14_react@18.2.0/node_modules/react-pdf-html/node_modules/@react-pdf/renderer/lib/react-pdf.cjs.js:4420:1)
at overridableRequire (:1:20)
at /node_modules/.pnpm/react-pdf-html@1.2.0_@react-pdf+renderer@3.1.14_react@18.2.0/node_modules/react-pdf-html/dist/renderers.js:8:6
at globalThis (/node_modules/.pnpm/react-pdf-html@1.2.0_@react-pdf+renderer@3.1.14_react@18.2.0/node_modules/react-pdf-html/dist/renderers.js:122:18) this is what I had in package.json
tried every solution suggested above, didn't work updated bun, - worked bun -v
1.0.12
curl -fsSL https://bun.sh/install | bash
######################################################################## 100.0%
bun was installed successfully to ~/.bun/bin/bun
Run 'bun --help' to get started
bun -v
1.0.29 |
my node version is 20.1.0 and still having this issue |
@shesha4kr In the same exact boat as you, were you able to find a solution? |
I think it's more a Webpack issue A simple workaround {
"scripts": {
"postinstall": "npm run fix:react-pdf",
"fix:react-pdf": "mv ./node_modules/yoga-layout/src/generated/YGEnums.ts ./node_modules/yoga-layout/src/generated/YGEnums_bkp.ts || echo \"not found or already processed\""
}
} |
@shesha4kr I got this error too. Did you resolve this? |
Mine was webpack issue. I did the changes in webpack.config.js as suggested |
Mine was webpack issue. |
@shesha4kr could you share your webpack config? |
@ryanpratama14 refer this repo. |
@ryanpratama14 and this was the fix |
@shesha4kr many thanks! |
i'm using webpack and in my wepack config i'm using with rules for ts file and exclude node_modules except yoga-layout and moduleX as below. It's worked for me and I forgot where I found the solution =)) |
…322) * RHINENG-8218 dependencies upgrade: react 18, patternfly V5 and more * @redhat-cloud-services/frontend-components-config V6 updates * updated codebase as per Patternfly V5 * fixed lint errors and codebase for patternfly V5 * fixed the issue with @react-pdf library more info here: diegomura/react-pdf#2499 * code fixes for React 18 & Patternfly 5, refactroing deprecated component * migrated code for deprecated dropdown patternfly component * removed obsolete tests and snapshots, added react testing library, updated jest * code refactor for RecommendationsTable component
…#322) * RHINENG-8218 dependencies upgrade: react 18, patternfly V5 and more * @redhat-cloud-services/frontend-components-config V6 updates * updated codebase as per Patternfly V5 * fixed lint errors and codebase for patternfly V5 * fixed the issue with @react-pdf library more info here: diegomura/react-pdf#2499 * code fixes for React 18 & Patternfly 5, refactroing deprecated component * migrated code for deprecated dropdown patternfly component * removed obsolete tests and snapshots, added react testing library, updated jest * code refactor for RecommendationsTable component
…#322) * RHINENG-8218 dependencies upgrade: react 18, patternfly V5 and more * @redhat-cloud-services/frontend-components-config V6 updates * updated codebase as per Patternfly V5 * fixed lint errors and codebase for patternfly V5 * fixed the issue with @react-pdf library more info here: diegomura/react-pdf#2499 * code fixes for React 18 & Patternfly 5, refactroing deprecated component * migrated code for deprecated dropdown patternfly component * removed obsolete tests and snapshots, added react testing library, updated jest * code refactor for RecommendationsTable component
Is there any latest solution to this problem? |
Solutions don't change weekly. Read through the thread. |
My level is limited. I read it twice and tried a lot, but still can’t solve it. |
This worked for me. Thanks a lot |
@KatFishSnake I had a similar issue with
Workaround 1 (downgrade to
|
What are we supposed to do when we don't use webpack (I'm on meteor for example)? Edit: Still the problem is there for newer versions and I'm having a hard time understanding it. If I understand it correctly, files are not resolved correctly if both a ts and a js version exist (as is the case with yoga-layout). But why does it even matter, shouldn't they contain the same code and as long as one of them resolved it's fine? |
can someone help me solve this error? ERROR in ../../node_modules/yoga-layout/src/generated/YGEnums.ts 10:7
webpack compiled with 1 error (05b2b0b974e03a93) |
upgrade to react-pdf v4 |
Indeed, it seems @takethefake @diegomura @wojtekmaj I guess this issue can be closed now? |
Closing! |
Describe the bug
I migrated today from
3.1.14
to3.1.17
and received the following error while deploying.this seems to be related to the migration to
yoga-layout@2.01
. I for now downgraded to@react-pdf/layout:3.6.4
via resolutions.The text was updated successfully, but these errors were encountered: