{"record":{"id":"a13e31bbdb493495","repo":"quasarframework/quasar","slug":"invalid-env-prefix-specified-using-default-def","errorCode":null,"errorMessage":"Invalid env prefix specified, using default \"${defaultPrefix}\" instead.","messagePattern":"Invalid env prefix specified, using default \"(.+?)\" instead\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app-vite/lib/utils/env.js","lineNumber":65,"sourceCode":"    if (!defaultPrefix) return ''\n    warn(\n      `No env prefix specified, using default \"${defaultPrefix}\" instead.`,\n      banner\n    )\n    return defaultPrefix\n  }\n\n  if (!Array.isArray(prefix)) {\n    if (!validEnvKeyRE.test(prefix)) {\n      if (!defaultPrefix) {\n        warn(\n          `The \"${prefix}\" env prefix is invalid in JS. Allowing all env keys that are valid in JS (without any prefix).`,\n          banner\n        )\n        return ''\n      }\n\n      warn(\n        `Invalid env prefix specified, using default \"${defaultPrefix}\" instead.`,\n        banner\n      )\n      return defaultPrefix\n    }\n\n    return prefix\n  }\n\n  const validPrefixList = []\n  for (const entry of prefix) {\n    if (!entry) continue\n\n    if (!validEnvKeyRE.test(entry)) {\n      warn(\n        `Invalid env prefix \"${entry}\" specified in the array. Skipping it.`,\n        banner\n      )","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/utils/env.js#L47-L83","documentation":"Same invalid-single-string-prefix case as the no-default variant, but here a defaultPrefix exists: the invalid configured prefix is discarded and the default (e.g. 'QCLI_') is used instead, after warning. The invalid prefix never takes effect.","triggerScenarios":"quasar dev/build with env.prefix (or clientPrefix/backendPrefix source) set to a string failing /^[a-zA-Z_$][a-zA-Z0-9_$]*$/ while the caller has a defaultPrefix; getEnvFilesPrefix falls back to it.","commonSituations":"Typos like 'q-cli_' vs 'QCLI_', hyphenated team prefixes, or forgetting prefixes must be valid JS identifier starts.","solutions":["Correct the prefix to a valid JS identifier in quasar.config > env.","If the default prefix is fine, delete the invalid prefix option and accept the (info-level) default warning.","Grep .env files and rename variables to the corrected or default prefix."],"exampleFix":"// before (quasar.config)\nenv: { prefix: 'app-env_' }\n// after\nenv: { prefix: 'APP_ENV_' }","handlingStrategy":"validation","validationCode":"const validEnvKeyRE = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/\nconst p = conf.env?.prefix\nif (typeof p === 'string' && p && !validEnvKeyRE.test(p)) {\n  console.warn(`env.prefix \"${p}\" invalid; falling back to default 'QCLI_'`)\n}","typeGuard":"function isValidEnvPrefix(v) {\n  return typeof v === 'string' && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(v)\n}","tryCatchPattern":null,"preventionTips":["Test the prefix against /^[a-zA-Z_$][a-zA-Z0-9_$]*$/ before committing config.","Remember the fallback default is 'QCLI_' for client builds; rename .env vars accordingly if you rely on defaults."],"tags":["env","config","naming"],"backgroundTag":"invalid-env-prefix","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}