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?

Pm Rivière
  • 191
  • 2
  • 13
  • Does this answer your question? [How to fix Next.js Vercel deployment module not found error](https://stackoverflow.com/questions/62378045/how-to-fix-next-js-vercel-deployment-module-not-found-error#62767826) – Leibale Eidelman Jan 24 '23 at 23:49

0 Answers0