When trying to run npm run build
for my NextJS 13 app, I encountered the following type error:
Type error: Type 'typeof import("E:/myapp/app/login/page")' does not satisfy the constraint 'IEntry'.
Types of property 'default' are incompatible.
Type 'typeof Login' is not assignable to type 'PageComponent'.
Type 'typeof Login' provides no match for the signature '(props: PageProps): ReactNode | Promise<ReactNode>'.
Here is a simple version of the Login
class referenced in the error message:
class Login extends React.Component<{}, {data: any}>{
constructor(props: any){
super(props);
this.state = {
data: null;
}
}
componentDidMount(){
//some logic
}
render(){
return <h1>Hello World</h1>
}
}
I'd appreciate any assistance in understanding why this error is occurring. Thank you!