mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
the `next_font_loaders` transform replaces imports from `next/font` with slightly different ones. unfortunately it was inserting these imports **at the top** of the file, which broke the `server_actions` transform because it expects "use server"/"use cache" directives to be the first item in the file. this PR changes the logic in the font transform to insert the import in the place where the original `next/font` import occurred instead of at the top of the file. (i suppose that we could just reorder the transforms and run `server_actions` before `next_font_loaders`, but this feels more robust) Fixes #72179
10 lines
210 B
JavaScript
10 lines
210 B
JavaScript
'use cache'
|
|
import React from 'react'
|
|
import { Inter } from '@next/font/google'
|
|
|
|
const inter = Inter()
|
|
|
|
export async function Cached({ children }) {
|
|
return <div className={inter.className}>{children}</div>
|
|
}
|