Next.js Discord

Discord Forum

Can somebody help me fix this issue?

Unanswered
Pembroke Welsh Corgi posted this in #help-forum
Open in Discord
Pembroke Welsh CorgiOP
Error after I create next js app. I think its because of my node. I used to have this error before, but still my app was running till a few days ago when it' s exactly like in the screenshot. I tried everything I found on internet: I uninstall and install again node, I run this command in CLI

npm set registry=https://registry.npmjs.org/ ,

but nothing seems to work. Do you have any idea how can I fix this bug?

20 Replies

did you restart vscode @Pembroke Welsh Corgi
@Arinji did you restart vscode <@902217265964015668>
Pembroke Welsh CorgiOP
yeah
@Pembroke Welsh Corgi yeah
what does hovering over show?
like the error
Pembroke Welsh CorgiOP
unreachable code detected
real quick, do this as well
ctrl shift p
>restart ts
Pembroke Welsh CorgiOP
same, unreachable code detected
send your code here pls @Pembroke Welsh Corgi
Pembroke Welsh CorgiOP
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body className={inter.className}>{children}</body>
    </html>
  );
}
its just a simple create next js app, which its not detected
my others projects have the same issue
i think its because of node
type node -v @Pembroke Welsh Corgi
Pembroke Welsh CorgiOP
its v22.3.0
hmm no clue then.. sorry :(
Pembroke Welsh CorgiOP
thank you for your help!
Polar bear
hey how did you create the nextjs app by using CMD commond or copy paste the old project @Pembroke Welsh Corgi
Polar bear
install node -v 20
some time node v 22 may cause this
it is under development