admin管理员组文章数量:1310203
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.
本文标签:
版权声明:本文标题:Vercel deployment works locally via CLI but fails with 404 Not Found or page not found when triggered via GitHub integration (As 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741809853a2398727.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论