mongoose.connect(), first argument should be String, received undefined June 5, 2023 by Tarik I think you miss importing env file. require('dotenv').config({ path: 'ENV_FILENAME' });