OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Error deploying MERN stack app to Vercel/Render: Cannot find module './mongodb_oidc/azure_machine_workflow'

  • Thread starter Thread starter Aryan Shah
  • Start date Start date
A

Aryan Shah

Guest
I'm currently developing an application using the MERN stack, and I'm in the process of deploying it. Everything works well locally. However, when I try to deploy it to Vercel or Render, I encounter the following error:

Code:
Cannot find module './mongodb_oidc/azure_machine_workflow' Require stack:

/var/task/backend/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js

/var/task/backend/node_modules/mongodb/lib/mongo_client_auth_providers.js

/var/task/backend/node_modules/mongodb/lib/mongo_client.js

/var/task/backend/node_modules/mongodb/lib/change_stream.js

/var/task/backend/node_modules/mongodb/lib/index.js Did you forget to add it to "dependencies" in package.json? Node.js process exited with exit status: 1. The logs above can help with debugging the issue. INIT_REPORT Init Duration: 690.68 ms Phase: invoke Status: error Error Type: Runtime.ExitError

This is my package.json

Code:
{
  "name": "musicback",
  "version": "1.0.0",
  "description": "",
  "type": "module",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "dev": "nodemon index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cors": "^2.8.5",
    "dotenv": "^16.4.5",
    "express": "^4.19.2",
    "mongodb": "^6.7.0",
    "mongoose": "^8.4.1",
    "nodemon": "^3.1.2"
  }
}

I have tried the following solutions:Installed all dependencies again. Updated all npm packages. Cleared the node cache. Despite these efforts, the error persists. As a new developer in full-stack development, I have not deployed an application before and couldn't find any information about this specific error online.

Any help or guidance would be greatly appreciated. Thank you!

<p>I'm currently developing an application using the MERN stack, and I'm in the process of deploying it. Everything works well locally. However, when I try to deploy it to Vercel or Render, I encounter the following error:</p>
<pre><code>Cannot find module './mongodb_oidc/azure_machine_workflow' Require stack:

/var/task/backend/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js

/var/task/backend/node_modules/mongodb/lib/mongo_client_auth_providers.js

/var/task/backend/node_modules/mongodb/lib/mongo_client.js

/var/task/backend/node_modules/mongodb/lib/change_stream.js

/var/task/backend/node_modules/mongodb/lib/index.js Did you forget to add it to "dependencies" in package.json? Node.js process exited with exit status: 1. The logs above can help with debugging the issue. INIT_REPORT Init Duration: 690.68 ms Phase: invoke Status: error Error Type: Runtime.ExitError

</code></pre>
<p>This is my package.json</p>
<pre><code>{
"name": "musicback",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "index.js",
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"mongodb": "^6.7.0",
"mongoose": "^8.4.1",
"nodemon": "^3.1.2"
}
}
</code></pre>
<p>I have tried the following solutions:Installed all dependencies again. Updated all npm packages. Cleared the node cache. Despite these efforts, the error persists. As a new developer in full-stack development, I have not deployed an application before and couldn't find any information about this specific error online.</p>
<p>Any help or guidance would be greatly appreciated. Thank you!</p>
 
Top