'Component' cannot be used as a JSX component.

import { type AppType } from "next/dist/shared/lib/utils";
import "~/styles/globals.css";

const MyApp: AppType = ({ Component, pageProps }) => {
return <Component {...pageProps} />;
};

export default MyApp;
import { type AppType } from "next/dist/shared/lib/utils";
import "~/styles/globals.css";

const MyApp: AppType = ({ Component, pageProps }) => {
return <Component {...pageProps} />;
};

export default MyApp;
I saw someone else had this issue, but their solution (Updating to Next.js 13.2.4) didn't seem to work for me, and as far as I can tell everything is up to date on my end. Getting this error:
4 Replies
π›ˆπž‚π—Ώπžˆπ’†π’ˆπ–π°π›ˆ 𝐜0πŸƒ3𝗿
Can you share more details and code? And what is the name of the file you are doing this in?
General Mudkipp
General MudkippOPβ€’2y ago
_app.tsx I don't think it's anything that I did, as I created a completely new project using the same configuration and I'm running into the same problem. I assume there's some dependency that's on the wrong version but I have no clue how to check, is there anything I can do? What's even stranger is that Vercel seems to be able to build it, but running npm run build on my terminal fails
Chizi Victor
Chizi Victorβ€’2y ago
I think your AppType is wrong
import type { AppProps } from 'next/app';
import "~/styles/globals.css";

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
}

export default MyApp;
import type { AppProps } from 'next/app';
import "~/styles/globals.css";

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
}

export default MyApp;
Could you give this a try…
General Mudkipp
General MudkippOPβ€’2y ago
I was able to solve the issue by downgrading to Next.js 13.2.4 Thanks for the advice though :)
Want results from more Discord servers?
Add your server