KeystoneJS (Headless CMS)

There is this project built for KeystoneJS CMS and MongoDB configuration. I tried to use this by Glitch remix feature.

I am facing a problem here. I am using MongoDB Atlas and the MONGO_URI starts with mongodb+srv:// but in the console I am getting an error saying that it must start with mongodb://

Please help me with this.

Thank You!

1 Like

Somebody else had this issue a few days ago, maybe this will help: Getting mongoose.connect error

Try removing the +srv from the URL. It indicates the usage of an additional protocol aside from the standard one for MongoDB.

Removing +srv does not work in any of the projects (and not just this). It says failed to connect to server

I read that article. Mongoose had to be updated and then it worked fine. But in my case there isn’t Mongoose package installed but some of the Keystone packages. Please tell me which npm package I must update (I can’t update all the packages because of the memory limit in the free account).

I rarely use Node.js but in this situation I would first update everything, that shouldn’t be an issue because Glitch projects have a separate 1 GB of storage space just for npm packages. This is a different storage allocation than the 200MB the project container has access to. If you tried that and got a storage error then I don’t know what to tell you…

If that doesn’t work I would modify the part that’s giving you trouble to use the latest mongoose package directly as that seems to have worked for others.

In mongoose.connect do you have the useNewUrlParser option enabled? I’m not sure if that is the issue, but i’s worth a try.