Open alexbjorlig opened 1 year ago
The warning in the build output is erroneous -- I'm about to push a fix. But the "not writing them to .vercel/output/config.json
" is intended -- we don't need to copy them over; Vercel will pick them up from vercel.json
. We only actually validate the paths at all as a courtesy. As long as they're in your vercel.json
, they'll be published to your project when your site builds on Vercel.
The warning in the build output is erroneous -- I'm about to push a fix. But the "not writing them to
.vercel/output/config.json
" is intended -- we don't need to copy them over; Vercel will pick them up fromvercel.json
. We only actually validate the paths at all as a courtesy. As long as they're in yourvercel.json
, they'll be published to your project when your site builds on Vercel.
That might be true if using Vercel git integration, but we deploy with the vercel deploy --prebuilt
, and in that case the CRON config is not working 😱
Fixed it with a small workaround, but would be amazing not having to do this
const vercelAsJson = JSON.parse(readFileSync('./vercel.json'));
const vercelConfig = JSON.parse(readFileSync('.vercel/output/config.json'));
const merged = { ...vercelConfig, ...vercelAsJson };
writeFileSync('.vercel/output/config.json', JSON.stringify(merged, null, 2));
process.exit(0);
but we deploy with the
vercel deploy --prebuilt
Out of curiosity, why
@Rich-Harris
For users that aren't using the Git integration, could we expose a copyVercelJson
config from @sveltejs/adapter-vercel
? It could basically just do what he's doing above. Default to false since most users don't need it.
Because Vercel does not have any tools built in for running db-migrations etc.
So to do that, the recommended way is to deploy from a github action (or similar) 🙃
Reopening to answer the above question
Yeah, I use --prebuilt
from time to time, especially if I'm testing unreleased libraries etc.
Do we need copyVercelJson
? Is there any downside in just always copying the relevant parts?
Looks like only the crons
key of vercel.json
is valid in config.json
. Maybe a more-targeted, less-likely-to-break solution is to only copy that key over if it's present. I'll open a PR for it.
Describe the bug
When using the vercel-adapter, cron jobs are ignored.
Reproduction
npm run build
cat .vercel/output/config.json
- no cron jobs specifiedLogs
No response
System Info
Severity
blocking an upgrade
Additional Information
There seems to also be a warning when building about the endpoint not being there, but it's there.
I might be missing something obvious, but I'm not sure what...