最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Vercel deployment works locally via CLI but fails with 404 Not Found or page not found when triggered via GitHub integration (As

programmeradmin0浏览0评论

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 1
Add a comment  | 

1 Answer 1

Reset to default 0

The 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论