question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable replacer does not take dotenv variables into account

See original GitHub issue
GET {{Url}}

The line above errors when Url is a dotenv variable. I added a breakpoint to the javascriptVariableReplacer function and inspected the context parameter. Sure enough, config-file variables were present in context.variables, but dotenv variables were not.

https://github.com/AnWeber/httpyac/blob/6616ca198ef0c5b4f0c544fcbb29f1acb1c70698/src/variables/replacer/javascriptVariableReplacer.ts#L7-L38

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
fredrikhrcommented, Nov 9, 2021

Yeah, totally right. Okay PR coming up 😃

1reaction
fredrikhrcommented, Nov 9, 2021

AH! The error occurs in getEnviromentConfig! If the config argument is specified it is merged in after the loaded config from the found rootDir of the httpFile.

https://github.com/AnWeber/httpyac/blob/7f887587d4a882ce74f840778d1aae7d20e7b526/src/store/httpFileStore.ts#L196-L204

Because of the following config initialize for the CLI, the envDirName get a value of env. https://github.com/AnWeber/httpyac/blob/7f887587d4a882ce74f840778d1aae7d20e7b526/src/cli/cli.ts#L103-L114

Read more comments on GitHub >

github_iconTop Results From Across the Web

After I get all variables that inside .env file how to replace the ...
parsed that is returned by dotenv.config is what was loaded from your path ( .env ) and does not take into account what's...
Read more >
How to update or reload env variables ? · Issue #122 - GitHub
I have a task using grunt-text-replace that replace some variable inside my .env file from users prompts. After the file .env has been ......
Read more >
Manage Environment Variables in your NodeJs Application ...
We will use the dotenv module to load environment variables from the .env file into process.env. Setup start script in package.json. Replace the ......
Read more >
Environment variables in Compose | Docker Documentation
Substitute environment variables in Compose files. If you have multiple environment variables, you can substitute them by adding them to a default environment...
Read more >
Using .env in .NET - Dusted Codes
init will run before I try to access the first env var, so I have to call DotEnv.init from the helper function which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found