No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. jvik
    3. Topics
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 9
    • Best 0
    • Groups 0

    Topics created by jvik

    • J

      Unable to access environment variables with square bracket notation
      Help • • jvik

      11
      0
      Votes
      11
      Posts
      1050
      Views

      beets

      @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]

    • J

      Apollo client typescript problem - Binding element 'Vue' implicitly has an 'any' type.
      Help • • jvik

      2
      0
      Votes
      2
      Posts
      588
      Views

      J

      okay. So “strict” was set to true in tsconfig. Disabled this and my headaches disappeared.