Additional Details
MY_PASSWORD=bug$
FOO=$bug
require('dotenv').config();
privateRuntimeConfig: {
myPassword: process.env.MY_PASSWORD,
foo: process.env.FOO
}
context.$config.myPassword should equal 'bug$'
context.$config.foo should equal '$bug'
context.$config.myPassword equals 'bugundefined'
context.$config.foo equals undefined (NOTE: not a string! This is the javascript value undefined)
This means that any value in .env that contains a '$' character wont work in $config, which seems highly likely given that you're probably keeping passwords, api keys, etc in .env
Perhaps related to https://github.com/nuxt/nuxt.js/issues/7990
Workaround:
Escaping the '$' in .env with a double backslash will produce the expected result in $config
MY_PASSWORD=bug\\$
FOO=\\$bug
Hi @gbruins-notours It should be fixed by #8013 (you can try with using nuxt-edge package). But escaping $ is best workaround.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
Most helpful comment
Perhaps related to https://github.com/nuxt/nuxt.js/issues/7990