Dev Server keep throw Unknown Error
Unanswered
American Coot posted this in #help-forum
American CootOP
Hi, has anybody encountered this error before can help me
I tried to delete .next folder and re-run npm run dev many times and it still throws this error, also I updated node version to the latest LTS one and then run npm i & npm update all this doesn't solve the problem
I tried to delete .next folder and re-run npm run dev many times and it still throws this error, also I updated node version to the latest LTS one and then run npm i & npm update all this doesn't solve the problem
16 Replies
Would you be able to share the code from the Layout.js?
@B33fb0n3 Would you be able to share the code from the Layout.js?
American CootOP
Sure
import type { Metadata } from "next";
import Providers from "@/store/Providers";
import { Toaster } from "react-hot-toast";
import "rsuite/dist/rsuite.min.css";
import "@/styles/main.min.css";
import "./globals.css";
import { Progress } from "@/components/ui";
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>
<Providers>
<Progress/>
<Toaster position={"top-left"} />
{children}
</Providers>
</body>
</html>
);
}Your layout component isn’t a client component, but you import Toaster. You could put the Toaster inside the Provider (which I think is a client component). Layouts should stay as server component
American CootOP
But Toaster itself is a client component why will change the Layout to client component if I import it?
what is the difference between it and any other client component like Provider?
Anyway, I'm working on this project with other developers and they don't have this error.
what is the difference between it and any other client component like Provider?
Anyway, I'm working on this project with other developers and they don't have this error.
Mossyrose gall wasp
if they dont have the issue maybe you should delete node modules yarn lock and next file then yarn && yarn dev
American CootOP
Actually, I deleted the node_modules folder and then run npm i npm run dev and nothing changed
Mossyrose gall wasp
.next folder?
American CootOP
.next as well
Mossyrose gall wasp
delete repo from local clone fresh one if still exists its not related to nextjs imo
American CootOP
I'll try
American CootOP
after I re-clone the repo it seemed to work but it back to throwing the same error after half an hour
the error occurred after many fast refreshes happened
Mossyrose gall wasp
my last advice is you should check permissions and node versions same with team to track if problem occur because of that or not
American CootOP
I have the latest TLS Node version v18.18.0
what did you mean by permissions?
what did you mean by permissions?
@American Coot I have the latest TLS Node version v18.18.0
what did you mean by permissions?
Mossyrose gall wasp
local enviroment permissions it usualy asks when you run it first time
American CootOP
I stopped the ESET antivirus and it doesn't throw any error over 2 hours, today I'll keep it stopped all the time and see if it has any role in the problem