Remix v2.8.1 (vite) on Vercel serverless function timeout when making xata db calls
The app is deploying properly and I can't see any issues in the runtime logs on Vercel. The serverless function (Node.js 20x) just timeouts after 60 seconds. Via console.logs I'm pretty sure it's related to a xata query.
In the build logs I see the following warnings (not sure if this is related):
WARN: Failed to resolve dependency "kerberos"WARN: Failed to resolve dependency "gcp-metadata"WARN: Failed to resolve dependency "socks"WARN: Failed to resolve dependency "snappy"WARN: Failed to resolve dependency "aws4"WARN: Failed to resolve dependency "mongodb-client-encryption"WARN: Failed to resolve dependency "@mongodb-js/zstd"WARN: Failed to resolve dependency "@aws-sdk/credential-providers"
WARN: Failed to resolve dependency "kerberos"WARN: Failed to resolve dependency "gcp-metadata"WARN: Failed to resolve dependency "socks"WARN: Failed to resolve dependency "snappy"WARN: Failed to resolve dependency "aws4"WARN: Failed to resolve dependency "mongodb-client-encryption"WARN: Failed to resolve dependency "@mongodb-js/zstd"WARN: Failed to resolve dependency "@aws-sdk/credential-providers"
I've checked that
process.env.XATA_API_KEY
process.env.XATA_API_KEY
and
process.env.XATA_BRANCH
process.env.XATA_BRANCH
are defined in the serverless function (via console.log) and they are.
I get the xata client like so:
export const xata = getXataClient();
export const xata = getXataClient();
Potentiall other relavant parts of the Vercel build logs:
Vercel CLI 33.6.1vite v5.1.6 building for production...
Vercel CLI 33.6.1vite v5.1.6 building for production...
I'm using
"@xata.io/client": "^0.29.3",
"@xata.io/client": "^0.29.3",
in package.json.
Any ideas how to further troubleshoot this? Thanks in advance!