mateonunez
mateonunez

Reputation: 197

No .env file found - Nuxt

I did move my source directory using srcDir prop. But when I start my local server console is giving me this error:

WARN No .env file found in ~\src nuxt:dotenv 11:19:47

Have you any ideas on how to fix this?

Upvotes: 1

Views: 2232

Answers (1)

mateonunez
mateonunez

Reputation: 197

It is necessary to specify the path to the .env file via the path option in the dotenv module declaration.

nuxt.config.js

  buildModules: [
    // dotenv
    ['@nuxtjs/dotenv', { path: './' }],
  ],

Upvotes: 3

Related Questions