mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #751] Build fails with Unexpected token in layout.tsx (default create-next-app next/font/google) #163
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kingRayhan on GitHub (Apr 2, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/751
Description
vinext buildfails on a stock create-next-app App Router project whose rootapp/layout.tsxusesnext/font/google(GeistandGeist_Monowithsubsets: ["latin"]). This is the default scaffold many users start from, so the failure blocks a straightforward migration to vinext.Reproduction
Repository: https://github.com/kingRayhan/vinext-poc
Actual behavior
Build fails during
[1/5] analyze client references...with:(The reported span lines up with the second
Geist_Mono({ ... })call in the default layout.)Expected behavior
vinext buildcompletes successfully, matching the documented support fornext/font/google(CDN / runtime loading per README).Environment
vinext^0.0.38vite^8.0.3@vitejs/plugin-rsc^0.5.21react/react-dom19.2.4Suspected cause (optional)
The
vinext:google-fontsbuild transform that injects_selfHostedCSSappears to insert, _selfHostedCSSbefore the closing}of the font options object. When the object uses a trailing comma after the last property (as create-next-app formats it), the result can contain a double comma (, ,), which would explain the parse error at the start of the injected property.If that diagnosis is wrong, the repro repo should still be enough to trace the real failure in
packages/vinext(e.g.plugins/fonts).@kingRayhan commented on GitHub (Apr 2, 2026):
Confirmed on our side: removing
next/font/googlefromapp/layout.tsxmakesvinext buildsucceed (same project otherwise unchanged). That matches the idea that the failure is in the Google Fonts build transform rather than the rest of the layout/metadata setup.We dropped the
Geist/Geist_Monohelpers and inlined plainclassName/ CSS (or system fonts) as a temporary workaround until this is fixed upstream.@james-elicx commented on GitHub (Apr 2, 2026):
Can you try with the new release please (v0.0.39) and see if that resolves the problem? I believe this is the same issue that was fixed by #719.
@DenyVeyten commented on GitHub (Apr 4, 2026):
Still happens for me on vinext v0.0.39