The string | argument undefined" cannot be assigned to the string parameter.
The undefined type cannot be assigned to the string type.ts(2345)
I can fix this error with setting an exclemation mark behind the Mongo_url like this: const conn = await mongoose.connect(process.env.MONGO_URL!);
But then the console tells me:
TypeError: Cannot read property ‘underline’ of undefined
When I log my MONGO_URL it gives me the correct connection path.
Can someone help me out? Thanks
Thanks for your answer kevinSmith. I have tested this and the console throws me no error ‘mongo url not defined’. But the app still crushes with the error:
cannot read property ‘underline’ of undefined
So I think conn.connection.host must be undefined.