I am trying to publish an Express JS API to Vercel (server, not serverless). I was able to follow some tutorials on getting it published. However, when running locally it works great. When pushing to Vercel i am getting a 500 due to the app crashing. When checking the logs, it shows a module is missing. Both mongodb and mongoose are within the package.json.
Does anyone have an idea on why this dependency is not able to be found?
Here is the stack trace from the logs:
Cannot find module ‘…/sdam/server_selection’
Require stack:
- /var/task/node_modules/mongodb/lib/operations/execute_operation.js
- /var/task/node_modules/mongodb/lib/admin.js
- /var/task/node_modules/mongodb/lib/index.js
- /var/task/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js
- /var/task/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js
- /var/task/node_modules/mongoose/lib/index.js
- /var/task/node_modules/mongoose/index.js