Error when deploying on vercel #856
Answered
by
ahohnsen
VanessaDiBella
asked this question in
Web
-
We created a database which we finished. we are currently in our PR Vercel shows us some errors with the deployment. We haven't found the error since then. Do you have any suggestions for us? |
Beta Was this translation helpful? Give feedback.
Answered by
ahohnsen
Aug 16, 2024
Replies: 1 comment 3 replies
-
Hi Vanessa! Unfortunately, the resolution of the screenshot is not good enough to read the error messages. 🙁 Have you set all the necessary environment variables for your Vercel deployment? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I took a closer look at your app. When you try to edit a workout—meaning you’re on the edit page—and then reload the page, an error occurs saying that
workouts
isundefined
.When you refresh the edit page, the browser makes a full HTTP request to the server for that specific URL. This results in a fresh load of the entire page:
useSWR
hooks start fetching data asynchronously from their respective APIs, but initially, the data isundefined
until the fetch completes.workouts
orexercises
while they are stillundefined
, you will encounter errors.I suggest to add an early return to ensure that your component does not try to access da…