I am getting this error from node modules in Replit "Cannot read property 'split' of null"

Tell us what’s happening:
Why i am getting node module error ?

var mongoose = require(‘mongoose’);
let Person;
const mySecret = process.env[‘MONGO_URI’]

mongoose.connect(mySecret,{ useNewUrlParser: true});

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0

Challenge: Install and Set Up Mongoose

Link to the challenge:

Do you have a link to an online IDE where we can see this?

Somewhere it is trying to run split (presumably on a string) that is actually null. It could be in your code or it could be something being fed to a library and it doesn’t know how to handle it.

A post was split to a new topic: Node - Cannot read property split of null

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