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
4 lines
283 B
JavaScript
4 lines
283 B
JavaScript
import React from 'react';
|
|
import firaCode from '@next/font/google/target.css?{"path":"pages/test.tsx","import":"Fira_Code","arguments":[{"variant":"400","fallback":["system-ui",{"key":false},[]],"preload":true,"key":{"key2":{}}}],"variableName":"firaCode"}';
|
|
console.log(firaCode);
|