conversation id undefiend error
getting this error when i click on a conversation in chat app and consol log says the conversation id is undefiend any idea how i can fix this ?
19 Replies
Looks like conversation id is undefined
if any one could help me it would be great
instead of saying the obvious
tnx agian sir
Is this from a template? You'll want to go through some basic troubleshooting steps, starting with logging the missing value directly, and determining where it's supposed to be set and why it isn't happening. Folks can assist better if you share relevant code.
which channel you recommend for that im new to this discord community general ?
Welcome! You're in the right spot for help, just need to share more info for folks to be able to help. With the error message you've shared, all I can see is that conversationId is undefined at runtime.
ok ty again ❤️
this is page.tsx for the conversations
Do you have any type errors? Typescript should be complaining wherever this component is used if it's possible for conversationId to be undefined.
no idont get any thing the ui works but when i click on a conversation i get errors like this
Type errors won't stop the ui from working
sending ss a momment
If typescript is not complaining, I would look for type assertions that might be hiding the problem.
Try
npx tsc
to check for type errorsok ty again iwill add more code for context mean while
this is the npx tsc log it seems there alot of problem 😅
You'll want to exclude the public directory in your tsconfig, once you do that there are only 12 errors remaining
Then go through those remaining errors. There are some in what you shared that include "Type 'undefined' is not assignable to type 'string'." - that's probably what you're looking for.
ty for the answering ❤️
well i fixed all the error i got from npx tsc
and yet getting same error
for some reason it points to api
which i cant understand why
this the app deployed on vercel https://ouan-app.vercel.app/conversations
Chat App
Realtime chat app built using NextJS
producing this error
and the first picture qwhen i run npm run dev
Your file path route param
conversationid
has lowercase i
but your React code has uppercase I
in conversationId
.