-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. #58055
Comments
@IlirEdis could you please tell me the above code is the root page inside app dir or no ? |
@Abdulahadahmadi no, its a dynamic page. |
@IlirEdis that's fine if its a dynamic page. for your dynamic page do you have a layout.tsx file ? |
@codewithahad01 Thank you for sharing! Is it possible to clarify how exactly we can replicate this? I was not able to replicate it with the latest stable v14.0.4. |
Yes, after adding multilingual support to Next.js, I also encountered this issue and couldn't figure out the cause. |
The same is happening with me. I think the error thrown is somehow captured |
Adding a layout.tsx file to the Dynamic Routing, e.g. [Slug] solved that Problem for me (Next.js 14.0.1) |
Same issue here with internationalization. We are using Edit And if you want to use the same next 404 interface you can add the following:
|
This comment has been minimized.
This comment has been minimized.
Just putting it here that I found helpful: docs |
I'm seeing the same error in production ( Error displayed in the browser:
Error logged in the console:
|
Anyone found a solution? I'm having the same issue with next@14.2.3 and next-intl@3.12.0 |
i also having the exact same error. i referred and this none of this worked for me. |
Guys, I found solution. If yout want to use option export const config = {
matcher: ['/', '/(es|de|fr|ja|hi|it|pl|pt|nl|ru|tr|zh|ko|vi)/:path*'],
}; I changed to export const config = {
matcher: ['/((?!api|_next|.*\\..*).*)'],
}; and now everything is ok. p.s.: not-found.tsx: 'use client';
import Error from 'next/error';
import React from 'react';
export default () => (
<html lang="en">
<body>
<Error statusCode={404} />
</body>
</html>
); layout.tsx : import {PropsWithChildren} from 'react';
export default ({children}: PropsWithChildren) => children; After that, I saw that I had a 404 error page on the "/about" page. This is a lot better than when the application crashed. https://next-intl-docs.vercel.app/docs/routing/middleware#locale-prefix-as-needed |
Thanks a lot, it's work for me |
|
I had same problem when I have started using next-i18n navigation, and I mixed from where I do "import { Link }" |
guys, I have the exacts same issue. im useing localePrefix = 'as-needed'. matcher: ["/((?!api|_next|.\..).*)"], |
if you get this error when you want to create multiple layout.jsx files for different parts of your application make sure to return a react fragment (<></>) from any layout.jsx component Except the root layout. so DO NOT return html and body tag again. |
Man.. this helped me a lot and this is the legit solution I guess.. |
FYI my issue was I was missing a layout.tsx at the root /app/ folder. I am using internationalization, so I have app/[locale]/ directory structure. My root layout was sitting at /app/[locale]/layout.tsx, but since moving it to /app/layout.tsx my |
Whenever I've had this error it's been because I've forgotten to add a The file's contents can be as simple as this, it just needs to exist:
|
thanks a lot @abolfazlNik |
I was getting this same error, but I realised that I am using next-intl for my entire web app, and I have placed not-found.tsx in app/not-found.tsx, but instead, it should be inside app/[locale]/not-found.tsx and the issue is resolved by doing that. |
I wrote a comment component with twikoo, if 'use client'
import Script from 'next/script'
export default function Comment() {
// replace <div> with <> will get error
return (
<div>
<div id="tcomment"></div>
<Script
src="https://cdn.jsdelivr.net/npm/twikoo@1.6.39/dist/twikoo.min.js"
onLoad={() => {
window.twikoo.init({
envId: '',
el: '#tcomment',
lang: 'zh-CN',
})
}}
/>
</div>
)
} Edited: But if a |
Workaround: 'use client'
import Script from 'next/script'
export default function Comment() {
return (
<div>
<div id="tcomment"></div>
<Script
src="https://cdn.jsdelivr.net/npm/twikoo@1.6.39/dist/twikoo.min.js"
onReady={() => {
console.log("excuted")
window.twikoo.init({
})
}}
/>
</div>
)
} |
I am also running into the same error when trying to use notFound(). |
Link to the code that reproduces this issue
https://github.com/Abdulahadahmadi/codewithahad.git
To Reproduce
I have a web app in Nextjs in Navbar component when I go to other router and return to main route it show the above error that I attach in title.
Current vs. Expected behavior
I tried many ways in stackoverflow and github issue that people suggested but I couldn't find the solution for this problem.
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Routing (next/router, next/navigation, next/link)
Additional context
I host this app in vercel
The text was updated successfully, but these errors were encountered: