admin管理员组文章数量:1331937
I'm trying to deploy my Astro project on Vercel, but the build keeps failing with the same error message:
at Object.stat (node:fs:1582:16)
at find (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:18384:2)
at async loadTsconfigJsonForFile (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:19432:20)
at async compileAstro (file:///vercel/path0/node_modules/astro/dist/vite-plugin-astro/compile.js:14:21)
at async transform (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:19663:16)
Error: Command "astro build" exited with 1
Does someone has experience with this error. I think it must have something todo with the tsconfig.json file, but I'm not sure. My tsconfig.json file looks like this:
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
"jsx": "react-jsx",
"jsxImportSource": "react",
"types": ["astro/client"],
"moduleResolution": "node"
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.astro"],
"exclude": ["node_modules", "dist"]
}
My astro.config.mjs file looks like this:
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import react from '@astrojs/react';
import vercel from '@astrojs/vercel/serverless';
import astroI18next from 'astro-i18next';
import { fileURLToPath } from 'url';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
output: 'server',
adapter: vercel({
webAnalytics: {
enabled: true,
},
}),
integrations: [tailwind(), react(), astroI18next()],
vite: {
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@components': fileURLToPath(new URL('./src/components', import.meta.url)),
'@assets': fileURLToPath(new URL('./src/assets', import.meta.url)),
},
},
optimizeDeps: {
include: ['react', 'react-dom'],
},
build: {
sourcemap: true,
},
},
});
My repository is at:
Thanks for your help,
Anthony
本文标签: astrojsAstro project fails to build on VercelStack Overflow
版权声明:本文标题:astrojs - Astro project fails to build on Vercel - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742262409a2442760.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论