#Working local project fails on Vercel
1 messages · Page 1 of 1 (latest)
Based on the information provided in the extracts, it seems like you might be encountering an issue with dynamic routes when deploying to Vercel. This issue has been reported in the Astro GitHub issues here (https://github.com/withastro/astro/issues/8009) and here (https://github.com/withastro/astro/issues/8407).
One of the common errors that occur with dynamic routes is the absence of a getStaticPaths() function. As per the error message in the first extract (https://github.com/withastro/astro/issues/8009), you need to make sure that you export a getStaticPaths function from your dynamic route. You can find more information about dynamic routes in the Astro documentation (https://docs.astro.build/en/core-concepts/routing/#dynamic-routes).
Another potential issue could be related to the Astro version or the SSR adapter you're using. Some users have reported issues with certain versions of Astro or when using the @astro/vercel SSR adapter, as seen in the second (https://github.com/withastro/astro/issues/4536), third (https://github.com/withastro/astro/issues/7608), fourth (https://github.com/withastro/astro/issues/6012), and fifth (https://github.com/withastro/astro/issues/5320) extracts.
If none of these solutions work, it might be helpful to check the console for any errors or warnings that could provide more insight into the issue.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@molten wolf kapa.ai is still learning and improving, please let us know how it did by reacting below
@sacred anchor Hmm what is @astro/vercel
I have astro latest, and I do export getStaticPaths so it doesn't apply, I don't see any error, I simply see a blank page
@sacred anchor Hmm what is @astro/vercel
I have astro latest, and I do export getStaticPaths so it doesn't apply, I don't see any error, I simply see a blank page
Let me check the knowledge base for you. One moment! :books:
The @astrojs/vercel is an adapter for Astro that allows you to deploy your Astro projects on Vercel. It's designed to work with Vercel's serverless platform and helps to handle server-side rendering (SSR) of your Astro components.
If you're seeing a blank page without any console errors, it could be due to a variety of reasons. Here are a few things you could check:
-
Check your component rendering: Ensure that your Astro components are being rendered correctly. In the code you provided, you're conditionally rendering components based on the
isDirectoryPagevariable. You might want to check if the conditions are being met and the components are being rendered as expected. -
Check your data fetching: You're using the
getCollection("posts")function to fetch blog entries. Make sure this function is working correctly and returning the expected data. -
Check your routes: Make sure the routes you're trying to access match the dynamic routes defined in your Astro pages. In your case, the dynamic route is
[...slug].astro, so the routes should match this pattern.