quasarframework/quasar · warning

Invalid env prefix "${entry}" specified in the array. Skippi

Error message

Invalid env prefix "${entry}" specified in the array. Skipping it.

What it means

When env.prefix is an array, each entry must itself be a valid JS identifier (validEnvKeyRE), since each will prefix variables exposed as import.meta.env keys. Empty entries are skipped silently; non-empty invalid entries trigger this warning and are skipped from the resulting validPrefixList.

Source

Thrown at app-vite/lib/utils/env.js:80

        return ''
      }

      warn(
        `Invalid env prefix specified, using default "${defaultPrefix}" instead.`,
        banner
      )
      return defaultPrefix
    }

    return prefix
  }

  const validPrefixList = []
  for (const entry of prefix) {
    if (!entry) continue

    if (!validEnvKeyRE.test(entry)) {
      warn(
        `Invalid env prefix "${entry}" specified in the array. Skipping it.`,
        banner
      )
      continue
    }

    validPrefixList.push(entry)
  }

  if (validPrefixList.length === 0) {
    if (!defaultPrefix) {
      warn(
        `No valid env prefix specified in the array. Allowing all env keys that are valid in JS (without any prefix).`,
        banner
      )
      return ''
    }

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Fix or remove the offending entry in the prefix array so all entries match /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.
  2. Drop empty strings too if you want cleaner logs (they are skipped silently).
  3. After fixing, rename .env variables to use one of the valid prefixes.

Example fix

// before (quasar.config)
env: { prefix: ['MYAPP_', 'client-1_'] }
// after
env: { prefix: ['MYAPP_', 'CLIENT1_'] }
Defensive patterns

Strategy: validation

Validate before calling

const validEnvKeyRE = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/
const list = conf.env?.prefix
if (Array.isArray(list)) {
  const bad = list.filter(e => e && !validEnvKeyRE.test(e))
  if (bad.length) throw new Error(`Invalid env prefixes: ${bad.join(', ')}`)
}

Type guard

function isValidPrefixArray(v) {
  return Array.isArray(v) && v.every(e => typeof e === 'string' && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e))
}

Prevention

When it happens

Trigger: quasar dev/build with env.prefix as an array containing at least one truthy but invalid entry (e.g. ['MYAPP_', 'client-1_']); invoked from the prefix/clientPrefix/backendPrefix getters.

Common situations: Mixing kebab-case names into the array, stray values with spaces, or including placeholder strings like '-' meant as separators.

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/f2e426dac2aa3e11. Report an issue: GitHub.