Anyone know how to fix this or know about it?
Answered
Red-billed Tropicbird posted this in #help-forum
Red-billed TropicbirdOP
NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
9 Replies
Red-billed TropicbirdOP
Here is the file I think causing it
import type { Metadata } from "next"
import { Ubuntu } from "next/font/google"
const ubuntu = Ubuntu({
weight: ["300", "400", "500", "700"],
subsets: ["latin"],
})
interface ResumeLayoutProps {
children: React.ReactNode
}
export default function ResumeLayout({
children,
}: ResumeLayoutProps): JSX.Element {
return (
<html lang="en" className="antialiased">
<body>{children}</body>
</html>
)
}Barbary Lion
you should use the Head component from
This may potentially be causing your issue.
next/head to manage the document head and the _document.js file to modify the <html> and <body> tags. You typically shouldn't render html or body tags directly in a component. Instead, you should use _document.js for these elements.This may potentially be causing your issue.
Red-billed TropicbirdOP
How doul that look?
would
@Red-billed Tropicbird Here is the file I think causing it
ts
import type { Metadata } from "next"
import { Ubuntu } from "next/font/google"
const ubuntu = Ubuntu({
weight: ["300", "400", "500", "700"],
subsets: ["latin"],
})
interface ResumeLayoutProps {
children: React.ReactNode
}
export default function ResumeLayout({
children,
}: ResumeLayoutProps): JSX.Element {
return (
<html lang="en" className="antialiased">
<body>{children}</body>
</html>
)
}
Spectacled bear
Is this the root layout of your app or you've created this layout for nested routes?
Red-billed TropicbirdOP
This is a layout for a nested route.
Red-billed TropicbirdOP
Is there something wrong or a reason this error may have occured?
@Red-billed Tropicbird Is there something wrong or a reason this error may have occured?
Spectacled bear
Remove <html> and body tag from this layout
Answer
Spectacled bear
like this:
export default function ResumeLayout({
children,
}: ResumeLayoutProps): JSX.Element {
return (
<div className="antialiased">
{children}
</div>
)
}