Skip to content Skip to sidebar Skip to footer

Typeerror: Cannot Read Property 'database' Of Undefined

I have two files-config.js and index.js The code I have written is as follows- config.js- module.exports={ port:process.env.PORT || 8081, db:{ database:process.env

Solution 1:

const config=('../config/config') - there is no require keyword here. So the config is not your config, just a string on the right. Hence accessing property of undefined, which is config.db.


Post a Comment for "Typeerror: Cannot Read Property 'database' Of Undefined"