1

My app is an API that serves data from a Redis db. It works all fine locally, but once deployed on Vercel I get this error:

undefined   ERROR   Cannot find module '@redis/client'
Require stack:
- /var/task/node_modules/redis/dist/index.js
- /var/task/helpers/redis.js
- /var/task/models/model.js
- /var/task/routes/routes.js
- /var/task/api.project.js
- /var/task/___now_launcher.js
- /var/runtime/index.mjs

Did you forget to add it to "dependencies" in `package.json`?
Cannot find module '@redis/client'

The app is successfully deployed but it actually fails to run.

I just use the package "redis": "^4.0.2" locally, but i tried to install the specific package @redis/client": "^1.4.2 as well to see if it'd fix the problem in Vercel. But the problem persists.

How to fix this?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.