Next.js Discord

Discord Forum

error 'OmitWithTag while building app

Answered
Magnificent Hummingbird posted this in #help-forum
Open in Discord
Avatar
Magnificent HummingbirdOP
.next/types/app/layout.ts:12:13
Type error: Type 'OmitWithTag<typeof import("D:/progam-code/next-project/pomodoro-app/src/app/layout"), "default" | "metadata" | "config" | "generateStaticParams" | "revalidate" | "dynamic" | "dynamicParams" | ... 7 more ... | "experimental_ppr", "">' does not satisfy the constraint '{ [x: string]: never; }'.
Property 'khand' is incompatible with index signature.
Type 'NextFontWithVariable' is not assignable to type 'never'.

10 |
11 | // Check that the entry is a valid entry
12 | checkFields<Diff<{
| ^
13 | default: Function
14 | config?: {}
15 | generateStaticParams?: Function


how can i fix it
Image
Answered by Asian black bear
You can't export fonts from the layout file. Remove the export keyword or move the fonts into a separate file.
View full answer

9 Replies

Avatar
Asian black bear
You can't export fonts from the layout file. Remove the export keyword or move the fonts into a separate file.
Answer
Avatar
Magnificent HummingbirdOP
but i'm watch in a youtube
he export font in _app.tsx, you know _app.tsx is layout next js 13, and it's work

https://www.youtube.com/watch?v=L8_98i_bMMA&t=176s
3:48
Avatar
Asian black bear
In the video he uses the pages router, not the app router.
And he doesn't export it either.
Avatar
Magnificent HummingbirdOP
oh..
okey thank you for you information
Avatar
Asian black bear
As I've said, just remove the export from your first two fonts.
This should already fix it.
Avatar
Magnificent HummingbirdOP
okey i will try to fix it
thank you for the solution you provided
now it's successful
Image