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.
1 Answer
Reset to default 0To 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.