M220 js :Cannot read property 'close' of undefined

Hi,

I’m having a problem running the following script on promt
npm test -t db-connection
but I am getting the following error
Cannot read property 'close' of undefined
my .env file is as follows

SECRET_KEY="qualquer_string_aq_dentro"
MFLIX_DB_URI=mongodb+srv://mflix-mi7h0.mongodb.net/test --username m220student
MFLIX_NS=sample_mflix
PORT=5000

if someone could help me, I would be grateful, because I really do not know what is causing this error

Hi Carlos,
Your MFLIX_DB_URI seems to have problem do check once, for me its something like below-
MFLIX_DB_URI=mongodb+srv://m220student:m220password@mflix-efnbo.mongodb.net/test?retryWrites=true&w=majority

1 Like