Code precompiled with react compiler doesn't work in NextJS #46
Replies: 1 comment 8 replies
-
I'm not sure I'm following what the issue is exactly, could you provide a repro? If I'm understanding correctly, you still need to use the |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
We have encountered a critical issue related to the Next.js React runtime compatibility after upgrading our monorepo to React 19. Despite following the officially recommended approach to precompile dependencies using React, the issue has left us unsure of the best way to handle it. vercel/next.js#73797
Key Points:
The Problem
Following the official guidance, we precompiled our UI kit libraries using the React Compiler before building the Next.js project. However, after upgrading, build failures occur during prerendering.
Attempting the Next.js Experimental Compiler:
To investigate, we disabled the precompilation step for our dependencies and enabled the Next.js experimental React Compiler feature. Surprisingly, this approach worked, and the project built and ran without issues.
However, this is contrary to the recommended practices and does not align with how we intended to structure and optimize our setup.
Conclusion
This situation has been a frustrating discovery, as it leaves us stuck between following official recommendations and a solution that technically works but contradicts best practices. We are eager to resolve this issue and would greatly appreciate clarity and guidance from the community or Next.js maintainers.
Beta Was this translation helpful? Give feedback.
All reactions