Repository dotenv-module


JulienTant resolved the question #c2

dotenv-module • 4 months ago

variables not defined on init


The dotenv-module won't overload the environment variables of the process running your build.

If you need to use variables from your .env file at this moment (and it looks like you do), just append require('dotenv').config() to your nuxt.config.js :


module.exports = {
    // your usual nuxt config.

This will works thanks to the dotenv library provided by this module as a dependency. If you decided to ignore some values from your .env file in the module configuration, this won't apply here.

Hope this help, i will update the README file with this, it can be useful !


VitorLuizC resolved the question #c7

dotenv-module • 5 months ago

Can't deploy to Netlify when using @Nuxt/dotenv

Its because @nuxtjs/dotenv can't use system's variables when .env file is not found #12.

You can deploy .env file too. It's a bad practice, but works.


JulienTant resolved the question #c6

dotenv-module • 5 months ago

Cannot add private key

I'm not sure how I can help you ?

That module is using this package to load variables from .env file : You should probably get help there !

Please reopen if I have misunderstood your problem


tamacroft posted a new question

dotenv-module • 5 months ago

Cannot add private key

i have try :
privatekey="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAAS….." or privatekey:-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAAS…
private_key:'-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAAS….'

but result is Certificate object must contain a string "private_key" property.


stuartjnelson posted a new question

dotenv-module • 5 months ago

Can't deploy to Netlify when using @Nuxt/dotenv


I've been unable to deploy to Netlify when using the plugin.

  • "@nuxtjs/dotenv": "^1.1.0"
  • "nuxt": "^1.0.0"
modules: [

Netlfiy Error log when using the module
Netfliy log for successful deployment

I've tried a whole bunch of different configurations inside nuxt.config.js but could'nt get anything to work. I don't get the issue when I generate the static site locally just when using Netlify. I have spoke to their support and they can't see the issue. I am wondering if its to do with the NPM WARN about missing optional dependencies? Let me know if you need anymore info!


gijo-varghese posted a new question

dotenv-module • 5 months ago

Use system process if .env file is not found

In our team, we would like to use .env file for local development. But it won't be committed to git. And while deploying it will take env variables from server. Right now when I add .env to .gitignore and when I try to build it from where, it throws an error saying that .env file is not found


s-ferdie posted a new question

dotenv-module • 6 months ago

fs dependency not found

I've follow the instructions to add the dotenv module.
When I run npm run dev I'm getting the following error:

This dependency was not found:

  • fs in ./node_modules/@nuxtjs/dotenv/dist/index.js

To install it, you can run: npm install --save fs

Digging into this npm package its seems to be a security-holder package.
How to solve the error?


koresar posted a new question

dotenv-module • 7 months ago

Clarify in README should it be devDependecy or dependency

Could someone please clarify if this should be a devDependency or dependency in package.json?


pSchaub posted a new question

dotenv-module • 7 months ago

Hot reload if .env file changes are happening

Hot reloading is not working if you do a simple change on your .env file.

Steps to reproduce:

  1. Start dev server (e.g. with npm run dev or yarn run dev)
  2. Change something in your .env file

sprabowo posted a new question

dotenv-module • 8 months ago

is there way to keep secret key in .env?

i see in my configuration that contain secret code in source code /_nuxt/app.1234132.js .env is loaded in.



pierre-aurele-martin posted a new question

dotenv-module • 10 months ago

is it working with nuxt / express ?


Sorry to interrupt here but I really can not manage to achieve a simple thing (read process.env)

#1 - Only way I can read what's in my .env file is by
in nuxt.config.js

When I'm adding it as a module, it doesn't find anything even if .env is at the root…

#2 still in nuxt.config.js I define :

 env: {
    test: process.env.TEST,

In server/index.js I define :

const test = process.env.test

And it's always undefined…

I've tried a lot and a lot of thing but I think I'm missing something here. Any help will be really appreciate !

thanks !


Decipher posted a new question

dotenv-module • 10 months ago

Allow path to .env to be overridden.

Currently this module expects that the .env file to live in the root of the NuxtJS project. I have a usecase where I wish for the .env file to live in another location so it can be shared among multiple projects.

As such, it would be ideal if the module accepted a path option.

PR incoming.


javialon26 posted a new question

dotenv-module • a year ago

variables not defined on init

the environment variables are not defined at the beginning. I am using the nuxtjs / axios module where I configure:

baseURL: process.env.API_URL,
browserBaseURL: process.env.API_URL_BROWSER

with this config an error occurs:

TypeError: Cannot read property 'substr' of undefined
    at ModuleContainer.nuxtAxios (/home/javier/vms/twobvm/projects/cominghouse/node_modules/@nuxtjs/axios/lib/index.js:38:46)

thank you!


greenkeeper[bot] posted a new question

dotenv-module • a year ago

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.