how do i get rid of this type error on build?

39 views Asked by At

I have this react component on src/app/LandingPage/page.tsx

import MainBar from "./main";
import { ReactNode } from "react";



export default function LandingPage({ children }: { children: ReactNode }) {
  return (
    <>
      {children}
      <div className="grow bg-pale_azure-700 flex items-center justify-around flex-col h-screen">
        <MainBar />
      </div>
    </>
  );
}

when i use npm run dev everything works fine but when i use npm run build i get this error message: `Linting and checking validity of types ..Failed to compile.

src/app/LandingPage/page.tsx Type error: Page "src/app/LandingPage/page.tsx" has an invalid "default" export: Type "{ children: ReactNode; }" is not valid.`

I thought maybe i made a type error so i just replaced ReactNode with any but no diffrence.

0

There are 0 answers