I have a turborepo with several sveltekit web apps in it. I am using caching. If one of my web apps is triggered for deployment by a repo change, and it gets a 100% turborepo cache, I get this 404 page:
我有一个带有几个sveltekit网络应用程序的turborepo。我正在使用缓存。如果我的某个Web应用程序因回购更改而触发部署,并且它获得了100%的turborepo缓存,我会看到这个404页面:
When I turn on directory listing, just to see whats in the directory, I see this:
当我打开目录列表时,仅仅是为了查看目录中的内容,我会看到以下内容:
And this is my vercel deployment configuration for the app:
这是我对该应用程序的Vercel部署配置:
The web app itself is this one - https://github.com/cozemble/monorepo/tree/main/frontend/ai-playground , so you can see all my configuration files.
Web应用程序本身就是这个-https://github.com/cozemble/monorepo/tree/main/frontend/ai-playground,所以你可以看到我所有的配置文件。
When a deployment to this app is triggered by a change to the app itself (meaning turborepo caching does not happen) then it deploys fine.
当应用程序本身的更改触发到该应用程序的部署时(这意味着不会发生turborepo缓存),那么它部署得很好。
Update 1 in reponse to the question from @paulogdm
, if I remove the Output Directory
override, and restore it back to public
, I get this deployment error when I deploy a fully cached turborepo build:
更新1在回答@paulogdm提出的问题时,如果我删除输出目录覆盖,并将其恢复为公共,则在部署完全缓存的turborepo版本时会出现以下部署错误:
更多回答
Did you try to remove the "Output Directory" override?
您是否尝试删除“输出目录”覆盖?
See Update 1
to the question @paulogdm
见问题@paulogdm的更新1
优秀答案推荐
Ok, it looks like there are two parts to fixing this:
好的,看起来要解决这个问题需要两个部分:
- revert the
Output Directory
override I did, so it defaults back to public
- Add ".vercel/**" to your list of build outputs in
turbo.json
. Mine now looks like this:
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", "package/**", ".svelte-kit/**", ".vercel/**"]
},
"test": {
"dependsOn": ["build"],
"outputs": [],
"inputs": []
},
"cypress": {
"dependsOn": ["build", "test"],
"inputs": ["cypress/**"],
"outputs": []
}
}
}
Super non-obvious, but there you go.
非常不明显,但这就对了。
更多回答
我是一名优秀的程序员,十分优秀!