Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

plugin works only once

Open
#13 16 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
tooling

Research direction

Reproduce the issue with Node 9.11.1 using the shown package.json and .babelrc, including a reload and a changed .env file or path. Start at the babel-plugin-inline-dotenv entry point and inspect how it reads and retains the .env path; done means repeated reloads populate process.env without reinstalling or changing the path option.

Written by the indexing model from the issue text.

Description

Once installed the plugin works as expected (loading my .env vars in process.env being used in webpack and all), but after a node reload or any changes, it suddenly stops to populate process.env.

I can make it to "work" again either by changing in .babelrc the path option value (which I should not need, my .env is at the root of my repository) or by running a new yarn install --dev babel-plugin-inline-dotenv to clean it up, which makes me wondered if there's some sort of cache messing up here ?
Once it stops working for a specific .env path, it won't use it again no matter what until reinstalled.

node version : 9.11.1

package.json (relevant part)

"@babel/cli": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.42",
"@babel/node": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.42",
"@babel/preset-react": "^7.0.0-beta.42",
"@babel/preset-stage-0": "^7.0.0-beta.42",
"@babel/register": "^7.0.0-beta.42",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-inline-dotenv": "^1.1.2",
"babel-plugin-transform-require-ignore": "^0.1.1",

.babelrc

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react",
    "@babel/preset-stage-0"
  ],
  "plugins": [
    ["inline-dotenv"]
  ],
  "env": {
    "development": {
      "plugins": [
        "react-hot-loader/babel"
      ]
    },
    "node": {
      "plugins": [
        "dynamic-import-node",
        [
          "transform-require-ignore",
          {
            "extensions": [".sass", ".scss", ".less"]
          }
        ]
      ]
    }
  }
}
Dominant language
JavaScript
Stars
123
Forks
12
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from brysgo/babel-plugin-inline-dotenv

All issues in brysgo/babel-plugin-inline-dotenv

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.