\r\n \u003C/div>\r\n\u003C/template>\r\n\u003Cscript setup>\r\nconst config = useRuntimeConfig();\r\nconsole.log(config);\r\n\u003C/script>\r\n\r\n```\r\n\r\nNow, when I build the project using `yarn build` and then run the production build using `node .output/server/index.mjs`, I get the following output:\r\n\r\n```shell\r\n~/projects/nuxt-starter-ilkcf5 6s\r\n❯ node .output/server/index.mjs\r\nListening http://[::]:3000\r\n{\r\n app: { baseURL: '/', buildAssetsDir: '/_nuxt/', cdnURL: '' },\r\n nitro: { routeRules: { '/__nuxt_error': [Object] }, envPrefix: 'NUXT_' },\r\n public: { apiBaseUrl: '' }\r\n}\r\n```\r\n\r\nNotice that the `config` variable that is getting logged in `app.vue` has a public key of `apiBaseUrl` as `\"\"` as opposed to `http://localhost:8000` as defined in the `.env` file.\r\n\r\nNOTE that this is not an issue when running `yarn dev`.\r\n\r\nJust want to know if this is really a bug or am I missing a step here.\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n```shell\r\n~/projects/nuxt-starter-ilkcf5 6s\r\n❯ node .output/server/index.mjs\r\nListening http://[::]:3000\r\n{\r\n app: { baseURL: '/', buildAssetsDir: '/_nuxt/', cdnURL: '' },\r\n nitro: { routeRules: { '/__nuxt_error': [Object] }, envPrefix: 'NUXT_' },\r\n public: { apiBaseUrl: '' }\r\n}\r\n```\r\n",[2957,2960],{"name":2958,"color":2959},"3.x","29bc7f",{"name":2905,"color":2906},15696,"Environment variables not synced from `.env` file on production build.","2023-01-19T18:20:11Z","https://github.com/nuxt/nuxt/issues/15696",0.65261537,{"description":2967,"labels":2968,"number":2970,"owner":2908,"repository":2908,"state":2925,"title":2971,"updated_at":2972,"url":2973,"score":2974},"Using the latest Nuxt starter kit (1.0.0-rc11), I tried testing environment variables on Zeit's Now deployment services and it's not working.\r\n\r\nnuxt.config.js\r\n```\r\n env: {\r\n apiUrl: process.env.API_URL || 'http://local.dev/api'\r\n }\r\n```\r\nOn deployment, it's never setting `apiUrl` to the environment variable `API_URL`.\r\n\r\nI have verified that the environment variables work in a basic app that is deployed with Now, so I think there is something weird going on with Nuxt.js and Now, or perhaps something SSR related that I'm unaware of?\r\n\r\nThe environment variables work when I deploy a static site to netlify though.\r\n\r\nAny ideas?\r\n\r\nIt's pretty easy to reproduce, just install the latest nuxt.js starter kit, add an env var and then deploy with Now.\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This bug report is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1702\">#c1702\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2969],{"name":2935,"color":2936},1902,"Environment Variables Not Working on Now/Zeit Deploys","2023-01-18T15:42:47Z","https://github.com/nuxt/nuxt/issues/1902",0.65529007,{"description":2976,"labels":2977,"number":2979,"owner":2908,"repository":2908,"state":2925,"title":2980,"updated_at":2981,"url":2982,"score":2983},"my nuxt.config.js \r\n\r\n```js\r\nrequire('dotenv').config()\r\n\r\nmodule.exports = {\r\n\r\n env: {\r\n API: process.env.API || 'http://localhost:8000',\r\n test: 'ting',\r\n },\r\n\r\n /*\r\n * Router config\r\n */\r\n router: {\r\n middleware: 'auth'\r\n },\r\n```\r\n\r\na console.log of `process.env` on any page or my `plugins/axios.js` always shows `{}`\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1230\">#c1230\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2978],{"name":2935,"color":2936},1386,"environment variables not working","2023-01-18T15:41:43Z","https://github.com/nuxt/nuxt/issues/1386",0.65577966,{"labels":2985,"number":2991,"owner":2908,"repository":2908,"state":2925,"title":2992,"updated_at":2993,"url":2994,"score":2995},[2986,2989,2990],{"name":2987,"color":2988},"stale","ffffff",{"name":2905,"color":2906},{"name":2935,"color":2936},10345,"Cannot read properties of undefined (reading 'stubModule')","2023-01-22T15:48:28Z","https://github.com/nuxt/nuxt/issues/10345",0.6571166,{"description":2997,"labels":2998,"number":3000,"owner":2908,"repository":2908,"state":2925,"title":3001,"updated_at":3002,"url":3003,"score":3004},"I can't find a way to access environment variables (especially within a component). I created a brand new project with:\r\n\r\n```bash\r\nvue init nuxt/starter new-project\r\ncd new-project\r\nnpm install\r\nnpm run dev\r\n```\r\n\r\n**nuxt.config.js**\r\n\r\n```\r\nmodule.exports = {\r\n ...\r\n env: {\r\n hey: 'hey'\r\n }\r\n}\r\n```\r\n\r\n**pages/index.vue**\r\n\r\n```\r\n\u003Cscript>\r\nimport Logo from '~/components/Logo.vue'\r\n\r\nexport default {\r\n components: {\r\n Logo\r\n },\r\n\r\n mounted () {\r\n console.log(process.env)\r\n }\r\n}\r\n\u003C/script>\r\n```\r\n\r\n`console.log()` prints an empty object. I read in [the documentation](https://nuxtjs.org/api/configuration-env) that you could access environment variables with `process.env`. What am I doing wrong? :)\r\n\r\nI am using the latest version of nuxt.js (`nuxt@1.0.0-rc3`) and my version of node is `8.2.1`.\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1172\">#c1172\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2999],{"name":2935,"color":2936},1323,"How do I access environment variables in a component?","2023-01-18T15:41:03Z","https://github.com/nuxt/nuxt/issues/1323",0.6574491,{"description":3006,"labels":3007,"number":3010,"owner":2908,"repository":2908,"state":2925,"title":3011,"updated_at":3012,"url":3013,"score":3014},"### Versions\r\n\r\n- nuxt: v2.15.7\r\n- node: v16.7.0\r\n\r\n### Reproduction\r\n\r\nhttps://github.com/dvlden/nuxt-generate-bug\r\n\r\n\r\n### Steps to reproduce\r\n\r\n- clone reproduction repository\r\n- install dependencies\r\n- `yarn run generate`\r\n- check `dist/index.html`, the custom meta tag will contain value of `APP_SPECIAL` env. variable, which is `holy.sh`\r\n- edit contents of `.env` file by changing `APP_SPECIAL` to something else\r\n- `yarn run generate`\r\n- check `dist/index.html`, the custom meta tag will remain untouched, the meta content will be what it was initially\r\n- `rm -rf dist .nuxt`\r\n- `yarn run generate`\r\n- still old value, it doesn't detect the change\r\n\r\n### What is Expected?\r\n\r\nAll `process.env` variables should exist so that their change can be tracked. This isn't the case when something is imported inside `nuxt.config.js` and used for configuration.\r\n\r\n\r\n### What is actually happening?\r\n\r\nIt seems that nuxt doesn't pick up env. variables that appear to be unused?\r\n\r\nIf you inspect `@nuxt/cli/dist/cli-generate.js` and log the `currentBuild`, you'll notice that `process.env` only contains `APP_SOMETHING` which is used in `nuxt.config.js` directly, through the constant. \r\n\r\nHowever, `APP_SPECIAL` is non-existent within `process.env`, but it's being imported from a file and used in example to create contents of a meta tag. I assume we could've use the imported constant for some other purpose too and it wouldn't detect a change.\r\n\r\nThis problem is happening for all `nuxt` scripts, not just `generate`.",[3008,3009],{"name":2905,"color":2906},{"name":2935,"color":2936},9688,"Environment variables not detected when used in config file from an imported source","2023-01-22T15:45:05Z","https://github.com/nuxt/nuxt/issues/9688",0.66046196,["Reactive",3016],{},["Set"],["ShallowReactive",3019],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fvPuTaY76e5Ck9O-PYiLGfZ5jxChjhYXQdkF2PrG3fAo":-1},"/nuxt/nuxt/27473"]