@jvik If your edited solution works, then great. It’s was a security improvement by quasar in a recent version so ENV vars aren’t bundled without being explicitly defined, which is a good thing, but would cause using the square brackets to have some issues.
You could also stringify the object into json if you’re still having problems:
build: { vueRouterMode: 'history', // available values: 'hash', 'history', env: { props: JSON.stringify(Object.entries(process.env).reduce((acc, [key, val]) => { if (key.startsWith('VUE_APP')) { acc[key] = val; } return acc; }, {})), }, }And in a boot file :
export default async ({ Vue }) => { Vue.prototype.$env = JSON.parse(process.env.props) }And then access it as this.$env[some_var]