Advanced node and express with repl error

Hello there, this advanced node challenge have to conect with database to implement the serialization of a passport user but the connection is always failing to connect

myDB(async client => {
  const myDataBase = await client.db('database').collection('users');

  // Be sure to change the title
  app.route('/').get((req, res) => {
    // Change the response to render the Pug template
    res.render('index', {
      title: 'Connected to Database',
      message: 'Please login'

  // Serialization and deserialization here...
  passport.serializeUser((user, done) => {
    done(null, user._id);
  passport.deserializeUser((id, done) => {
    myDataBase.findOne({ _id: new ObjectID(id) }, (err, doc) => {
      done(null, doc);
  // Be sure to add this...
}).catch((e) => {
  app.route('/').get((req, res) => {
    res.render('index', { title: e, message: 'Unable to login' });

Here’s the link to the repl
The error in console is type error of “split”
But never used the split in entire code

Link to Repl

Hello there,

Did you complete this step:

To do this, add your database’s connection string (for example: mongodb+srv:// ) to the environment variable MONGO_URI . This is used in the connection.js file.

Remember, environment variables are stored in a .env file (you will need to create one, if you have not), and they take the form:


No, ; at the end, and no space between the = and the content.

Hope this helps

Environment variable is working completely fine and problem is with connection which is spliting the null and how to stop it ?

Found out the error,the presence of two env files and having same variables in both files.
Removed the sample environment file.
Thank you, you are right @Sky020