diff --git a/backend/src/config/index.js b/backend/src/config/index.js index 4c81bb181..29d9f46e5 100644 --- a/backend/src/config/index.js +++ b/backend/src/config/index.js @@ -1,7 +1,12 @@ import dotenv from 'dotenv' if (require.resolve) { // are we in a nodejs environment? - dotenv.config({ path: require.resolve('../../.env') }) + try { + dotenv.config({ path: require.resolve('../../.env') }) + } catch (error) { + if (error.code !== 'MODULE_NOT_FOUND') throw error + console.log('WARN: No `.env` file found in /backend') // eslint-disable-line no-console + } } // eslint-disable-next-line no-undef