'Component' cannot be used as a JSX component.

import { AppProps } from 'next/app';
import { api } from '~/utils/api';
import '~/styles/globals.css';

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

export default api.withTRPC(MyApp);
import { AppProps } from 'next/app';
import { api } from '~/utils/api';
import '~/styles/globals.css';

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

export default api.withTRPC(MyApp);
Can somebody tell me why I am getting this error?:
15 Replies
artoo.r2
artoo.r22y ago
@yourny loves tits had the same issue the other day. That error should be coming from having @types/react-dom installed. (At least, for me)
yourny🤫🧏🏼
that's not working for me unfortunately I'm literally encountering this problem every T3 project I create
slogged
slogged2y ago
did u try turning it off and then on
yourny🤫🧏🏼
turning what?
slogged
slogged2y ago
does your app compile and run
yourny🤫🧏🏼
it does run it doesn't compile due to that error
slogged
slogged2y ago
?
yourny🤫🧏🏼
npm run dev works npm run build doesn't
slogged
slogged2y ago
oh could be a number of things, hard to help with out a reproducible env smells like an LSP error to me tho
yourny🤫🧏🏼
what a lsp error is? @Slogged what if I create a sandbox of the project?
PotatisMannen
PotatisMannen2y ago
that would be a good idea in this case because if you can reproduce the error in a sandbox we can debug the type dependencies. otherwise its like "this runs on my machine, but not yours" kindof scenario whats the next version of your project btw?
yourny🤫🧏🏼
13.4.1 Deploying btw ^ just updated to 13.4.2 but still getting the error
PotatisMannen
PotatisMannen2y ago
ahhh...you dont think this is an issue with types being updated in 13? have you tried using next 12? i know ideally you wanna be on 13 but still, could give us more info if we know the result with 12, no?
yourny🤫🧏🏼
I installed 13.2.4 and It's working Maybe there's some compatibility problem with the new version
PotatisMannen
PotatisMannen2y ago
Definitely
Want results from more Discord servers?
Add your server