Next.js Discord

Discord Forum

Type error: Page "..." has an invalid "default" export: Type "..." is not valid in Next.js

Answered
Thai posted this in #help-forum
Open in Discord
ThaiOP
when i use npm run build in app-router nextjs 13.5 , i found error Linting and checking validity of types .Failed to compile. How can i fix?? thank you

src/app/auth/signIn/page.tsx
Type error: Page "src/app/auth/signIn/page.tsx" has an invalid "default" export:
Type "ISignInProps" is not valid.
import React from 'react';

import LoginSection from '@/components/login/LoginSection';

type Props = {
error: any;
searchParams?: Record<'callbackUrl' | 'error', string>;
};

const SignInPage = (props: Props) => {

return (
<div className=''>
<LoginSection
error={props.searchParams?.error}
callbackUrl={props.searchParams?.callbackUrl}
/>
</div>

);
};

export default SignInPage;
Answered by Ray
remove error from the Props
type Props = {
  searchParams?: Record<'callbackUrl' | 'error', string>;
};
View full answer

3 Replies