help with server-side-example-serverless-vercel
# support
r
When I go to https://server-side-example-serverless-vercel-black.vercel.app/api/webhook following a readme instruction, I have a "Cannot read properties of undefined (reading 'message')" page. What does it mean and how to fix it? Please help!:)
v
Hi @Rafał Florek, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Server URLs]() * [Server Events]() * [Get Call]() * [Call Ended Reason]() -----------------------------
### Answer The error message "Cannot read properties of undefined (reading 'message')" typically suggests that there's an attempt to access a property of an object that hasn't been defined or initialized yet in your Next.js application. This kind of issue often arises due to the code trying to use an object or variable before it has been properly established or returned from an asynchronous operation. Without specific details from the official documentation or error messages directly related to Vapi from the provided information sources, a general advice would be to: - Ensure that any variables or objects you're trying to access are correctly initialized before you try to use them. - Check if the issue arises from server-side code trying to access browser-specific objects like
navigator
or
window
, which are not available in a server-side context like Vercel's serverless functions. This is a common issue with server-rendered applications and might require conditional checks to ensure code execution only happens in the browser environment. For more detailed debugging, inspect the serverless function logs in your Vercel dashboard, which might give you more insight into what's causing the error. Additionally, reviewing the part of your code referenced in the error message and ensuring that all asynchronous operations are correctly awaited can help identify the cause. Given the nature of your issue, it might also be helpful to review common Next.js practices for handling serverless functions and accessing API endpoints to ensure your implementation aligns with expected patterns. Since this response doesn't directly address a Vapi-related question and no specific documentation from Vapi matches this context, it's based on general web development practices.
Got it. Tagging @User for additional help.
r
this is from https://github.com/VapiAI/server-side-example-serverless-vercel repo. Haven't changed anything. I just followed the readme instructions.
s
can you share a loom video so that I can help you out?
r
hi, what would you like to have on video?
s
Basically of error message