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

reactjs - Vercel Build Failure - Stack Overflow

programmeradmin5浏览0评论

Out of the blue our React application started failing the build with this error:

Error: '/vercel/output/functions/api/FOLDER_NAME/ANOTHER_FOLDER_NAME/FUNCTION_NAME.func/.vc-config.json' already exists

I see this warning before Vercel checks the functions

@vercel/build is currently force building /api files itself, with no way to disable it. In order to avoid double compilation, you should temporarily rename /api to /_api while using this plugin. /_api functions are compiled under .vercel/output/functions/api/*.func as if they were in /api.

So I've tried to change to _api and it worked, the issue is my app stops working, no even the authentication works with _api, so I'm in a dead end. We use Vite and Vercel CLI to run locally.

Out of the blue our React application started failing the build with this error:

Error: '/vercel/output/functions/api/FOLDER_NAME/ANOTHER_FOLDER_NAME/FUNCTION_NAME.func/.vc-config.json' already exists

I see this warning before Vercel checks the functions

@vercel/build is currently force building /api files itself, with no way to disable it. In order to avoid double compilation, you should temporarily rename /api to /_api while using this plugin. /_api functions are compiled under .vercel/output/functions/api/*.func as if they were in /api.

So I've tried to change to _api and it worked, the issue is my app stops working, no even the authentication works with _api, so I'm in a dead end. We use Vite and Vercel CLI to run locally.

Share Improve this question asked Mar 21 at 1:45 Diego FilastroDiego Filastro 114 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

To whoever face this issue in the future, in our case it was caused by a plugin called 'vite-vercel-plugin' which configs how Vite projects integrate with Vercel's Serverless functions and one of the things it does is to manually generate an '.vercel/outputs' folder, which was causing the conflict with the one generated automatically by Vercel, in addition of that, we've noticed that this plugin started updating their dependencies about 2/3 weeks ago, which is around the time we started facing these issues, although it might be just coincidence, we've solved our issue by removing this plugin from our project.

发布评论

评论列表(0)

  1. 暂无评论