gpt4 book ai didi

404 NOT FOUND when deploying sveltekit to vercel using turborepo, when 100% turborepo cache hit(在使用turborepo将sveltekit部署到Vercel时未找到404,当100%turborepo缓存命中时)

转载 作者:bug小助手 更新时间:2023-10-25 20:02:05 26 4
gpt4 key购买 nike



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页面:


enter image description here




When I turn on directory listing, just to see whats in the directory, I see this:

当我打开目录列表时,仅仅是为了查看目录中的内容,我会看到以下内容:


enter image description here


And this is my vercel deployment configuration for the app:

这是我对该应用程序的Vercel部署配置:


enter image description here




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版本时会出现以下部署错误:


enter image description here


更多回答

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:

好的,看起来要解决这个问题需要两个部分:



  1. revert the Output Directory override I did, so it defaults back to public

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

非常不明显,但这就对了。


更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com