Subscribe on changes!

Serverless function not installing dependencies

avatar
Feb 15th 2024

Vue version

20

Link to minimal reproduction

https://github.com/jiwidi/lens-database-web

Steps to reproduce

Deploy this repository in vercel. The package.json includes vercel library to access psql but the serverless function (run when opening the page) will fail with logs:

Cannot find module '/var/task/node_modules/@vercel/postgres/dist/index-node.cjs'
Did you forget to add it to "dependencies" in `package.json`?
INIT_REPORT Init Duration: 282.31 ms	Phase: init	Status: error	Error Type: Runtime.ExitError
Cannot find module '/var/task/node_modules/@vercel/postgres/dist/index-node.cjs'
Did you forget to add it to "dependencies" in `package.json`?
INIT_REPORT Init Duration: 349.58 ms	Phase: invoke	Status: error	Error Type: Runtime.ExitError
Error: Runtime exited with error: exit status 1

I even tried to override build and install commands on vercel UI to have npm install @vercel/postgres but it hasnt worked.

What is expected?

Serverless function should have @vercel/postgres installed to it

What is actually happening?

Serverless function is missing dependencies

System Info

Running on vercel

Any additional comments?

No response

avatar
Feb 15th 2024

This seems unrelated to Vue. Might want to report to Vercel?