I’m working on an Astro.js project and deploying it to Vercel. When I deploy using the Vercel CLI (vercel or vercel deploy), everything works perfectly. However, when the deployment is triggered automatically via GitHub integration, I get a 404 Not Found or "page not found" error.
I followed the Astro documentation for deploying to Vercel, and my astro.config.mjs file is configured as follows:
import { defineConfig } from "astro/config";
import react from "@astrojs/react";
import tailwind from "@astrojs/tailwind";
import vercel from "@astrojs/vercel";
export default defineConfig({
integrations: [
react(),
tailwind({
applyBaseStyles: false,
}),
],
output: "static",
adapter: vercel(),
});
Initially, I had 'server' in my astro.config file, but it caused errors during the build process. I updated it to use 'static' instead.
What I’ve Tried So Far: Build Command:
"scripts": {
"build": "astro build"
}
Deployment Logs: Checked the deployment logs in the Vercel dashboard, but there are no obvious errors during the build process.
GitHub Integration: Confirmed that the correct branch is linked and that the repository is properly connected to Vercel.
Additional Details: Astro version: 5.2.3
Vercel CLI version: 40.1.0
Node.js version: v20.16.0
Repository:
Despite these steps, the automatic GitHub-triggered deployment still results in a 404 Not Found error. What could be causing this discrepancy, and how can I resolve it?
Questions:
Could the issue be related to the output: "static" configuration in astro.config.mjs?
Are there any differences between how Vercel CLI and GitHub integration handle the build process?
Are there any additional settings or configurations I might be missing?
Any help or suggestions would be greatly appreciated!
I’m working on an Astro.js project and deploying it to Vercel. When I deploy using the Vercel CLI (vercel or vercel deploy), everything works perfectly. However, when the deployment is triggered automatically via GitHub integration, I get a 404 Not Found or "page not found" error.
I followed the Astro documentation for deploying to Vercel, and my astro.config.mjs file is configured as follows:
import { defineConfig } from "astro/config";
import react from "@astrojs/react";
import tailwind from "@astrojs/tailwind";
import vercel from "@astrojs/vercel";
export default defineConfig({
integrations: [
react(),
tailwind({
applyBaseStyles: false,
}),
],
output: "static",
adapter: vercel(),
});
Initially, I had 'server' in my astro.config file, but it caused errors during the build process. I updated it to use 'static' instead.
What I’ve Tried So Far: Build Command:
"scripts": {
"build": "astro build"
}
Deployment Logs: Checked the deployment logs in the Vercel dashboard, but there are no obvious errors during the build process.
GitHub Integration: Confirmed that the correct branch is linked and that the repository is properly connected to Vercel.
Additional Details: Astro version: 5.2.3
Vercel CLI version: 40.1.0
Node.js version: v20.16.0
Repository: https://github/Eduwilll/my-aws-docs
Despite these steps, the automatic GitHub-triggered deployment still results in a 404 Not Found error. What could be causing this discrepancy, and how can I resolve it?
Questions:
Could the issue be related to the output: "static" configuration in astro.config.mjs?
Are there any differences between how Vercel CLI and GitHub integration handle the build process?
Are there any additional settings or configurations I might be missing?
Any help or suggestions would be greatly appreciated!
Share Improve this question asked Feb 3 at 16:33 Eduardo FabricioEduardo Fabricio 11 Answer
Reset to default 0The problem was resolved, but I'm not sure what exactly caused it. I had committed new features and took the opportunity to update Astro from version 5.1.7 to 5.2.3, and that fixed it.