[docs] Availability of process environment variables
See original GitHub issueWhen using the Quasar CLI, if I have:
data () {
return {
process: process,
env: process.env
}
},
and in the template:
{{ process.env.DEV }} / {{ env.DEV }}
it ouputs : / true (seen in the browser and in cordova)
So AFAIK it means that process or env itself is reassigned at some point, and only keeping a direct reference to the process.env object at the creation of the component works.
This is the console log of process later on when the env object is empty:

If it’s not a bug I believe it should be documented on this page: https://quasar.dev/quasar-cli/cli-documentation/handling-process-env.
Thank you
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Built-in environment variables | Workflows - Google Cloud
List of built-in environment variables. You can use the following built-in environment variables: GOOGLE_CLOUD_LOCATION : The location of the workflow.
Read more >Introduction to environment variables - CircleCI
Use environment variables to set up various configuration options, and keep your set-up secure with secrets, private keys, and contexts.
Read more >Environment variables to configure the AWS CLI
Environment variables provide another way to specify configuration options and credentials, and can be useful for scripting or temporarily setting a named ...
Read more >Environment variables - Workers - Cloudflare Docs
Adding environment variables via wrangler ... Environment variables are defined via the [vars] configuration in your wrangler.toml file and are ...
Read more >Environment Variables - The Java™ Tutorials
The conventions for setting and using environment variables vary between operating systems, and also between command line interpreters. To learn how to pass ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The
processobject is only available in the context of a node.js application. Webpack automatically removes it for you.For Vue CLI there is some documentation here: https://cli.vuejs.org/guide/mode-and-env.html#modes
How WebPack’s DefinePlugin works is explained here: https://webpack.js.org/plugins/define-plugin/
The Quasar CLI works a bit differently than the Vue CLI, but I believe the idea is the same. There is even a section that explains how it (Webpack) strips out code when running in different modes: https://quasar.dev/quasar-cli/cli-documentation/handling-process-env#Stripping-out-code
Edit: The above Quasar CLI documentation page does not mention Webpack at all. I think it should be updated to be more descriptive.
Be careful, especially if you are using either of the @quasar/qenv or @quasar/dotenv app extensions in the Quasar CLI (which is what we recommend).
While @MartinManev makes a good point, he is comparing Vue CLI to Quasar CLI. They are very different things.