-
-
Notifications
You must be signed in to change notification settings - Fork 244
Open
Labels
Description
Describe the bug
Creating an optimized production build ...
Failed to compile.
src\app\layout.js
An error occurred in next/font.
TypeError: require(...) is not a function
Configuration:
'@fullhuman/postcss-purgecss': {
content: [
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/lib/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}'
],
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
}
Layout:
import { Inter } from 'next/font/google';
const inter = Inter({ subsets: ['latin'], display: 'swap' });
export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}
It doesn't work with "@fullhuman/postcss-purgecss": "7.0.1-alpha.0" OR "@fullhuman/postcss-purgecss": "7.0.2"
but work with "@fullhuman/postcss-purgecss": "6.0.0"
To Reproduce
- Install Next 14.2.5
- Install "@fullhuman/postcss-purgecss": "7.0.1-alpha.0" OR "@fullhuman/postcss-purgecss": "7.0.2"
- Use 'next/font/google' in layout
- Run build
Expected Behavior
Build should be successful
Environment
OS: Windows
Next: 14.2.5
"@fullhuman/postcss-purgecss": "7.0.1-alpha.0" OR "@fullhuman/postcss-purgecss": "7.0.2"
Add any other context about the problem here
context
Code of Conduct
- I agree to follow this project's Code of Conduct