Closed ckruppe closed 2 months ago
One fast and simple fix would be to provide an second Root component that does not leverage next/font in the payload/next package. As the page lives already in userland, one could decide which to import. Only disadvantage would be that people maybe don't expect the long compile times with Babel because of loadash as it seems. (But could be warned against in the documentation).
I think it would really be an blocker for many to integrate payload in existing workflows that use babel as not all workflows can be easily swapped to swc. (Especially if your team does not know rust to convert custom plugins or has so many it does not have the time for that.)
@tylandavis this is another mention of Google fonts getting in the way of things. I would love to get around it somehow..... are there ANY good Windows / Linux / Mac OS serif fonts which are globally available?
I think we should go with Georgia
as a replacement. It's installed on MacOS and Windows by default, and also slightly common on Linux. Georgia is slighly less-wide than Merriweather, but it is web-optimized and would look much better than say Times New Roman.
Merriweather:
Georgia
To cover our bases for Linux, we could use this font stack of Georgia-like fonts. (looks like it would cover most users)
font-family: Georgia, "Bitstream Charter", "Charis SIL", Utopia, "URW Bookman L", serif;
@ckruppe next/font
has been removed in the latest beta (v3.0.0-beta.74) and is now optional.
Thanks very much for the fast mitigation. We do really appreciate your efforts. :)
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
No response
Payload Version
3.0.0-beta.67
Node Version
20.11.1
Next.js Version
15.0.0-rc.0
Describe the Bug
Payload breaks with custom babel config. As of incompatibillities with next/font. Following error gets thrown after 50 seconds and up compiling:
⨯ ./node_modules/@payloadcms/next/dist/layouts/Root/index.js:5:1 Syntax error: "next/font" requires SWC although Babel is being used due to a custom babel config being present. Read more: https://nextjs.org/docs/messages/babel-font-loader-conflict ⨯ ./node_modules/@payloadcms/next/dist/layouts/Root/index.js:5:1 Syntax error: "next/font" requires SWC although Babel is being used due to a custom babel config being present. Read more: https://nextjs.org/docs/messages/babel-font-loader-conflict
It would be good to at least have some option to opt out of this. We use at work many custom babel plugins that are needed for our usecases and this would prevent us from adapting Payload in our workflow.
Reproduction Steps
Using an babel config in your project is all whats needed to produce this error.
Adapters and Plugins
No response