Require statement results in infinite load

I have the following code:

const mongoose = require('mongoose');
const mongodb = require('mongodb');

const dbUrl = "mongodb://hyperstream.glitch.me/database";
mongoose.connect(dbUrl);


// const Post = require('/schemas/Post.js').Post;
// const User = require('/schemas/User.js').User;
// const Comment = require('/schemas/Comment.js').Comment;
// const Bot = require('./bot.js');



// module.exports = {
//   insertUser: async (userName, password) => {
//     try {
//       const doesExist = await User.exists({
//         username: userName
//       });
//       if (doesExist) {
//         return false;
//       }
//       const newUser = await User.create({
//         username: userName,
//         password: password
//       });
//       return true;
//     }
//     catch(err) {
//       return err;
//     }
//   }
// };

If I comment out all the require statements, the site works fine, but if I uncomment any one of the require statements, the site goes into an infinite load.

Can someone help me fix this issue? I’ve been at this for like a week.

Can you add me on the project?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.