{"record":{"id":"27e513c7b52b84a0","repo":"quasarframework/quasar","slug":"no-valid-env-prefix-specified-in-the-array-allowi","errorCode":null,"errorMessage":"No valid env prefix specified in the array. Allowing all env keys that are valid in JS (without any prefix).","messagePattern":"No valid env prefix specified in the array\\. Allowing all env keys that are valid in JS \\(without any prefix\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app-vite/lib/utils/env.js","lineNumber":92,"sourceCode":"\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      )\n      continue\n    }\n\n    validPrefixList.push(entry)\n  }\n\n  if (validPrefixList.length === 0) {\n    if (!defaultPrefix) {\n      warn(\n        `No valid env prefix specified in the array. Allowing all env keys that are valid in JS (without any prefix).`,\n        banner\n      )\n      return ''\n    }\n\n    warn(\n      `No valid env prefix specified in the array, using default \"${defaultPrefix}\" instead.`,\n      banner\n    )\n    return defaultPrefix\n  }\n\n  return validPrefixList\n}\n\nfunction convertFileToArray(value) {\n  if (Array.isArray(value)) return value","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/utils/env.js#L74-L110","documentation":"After filtering an env.prefix array, if no entry survived validation (all empty or invalid) and no defaultPrefix exists, getEnvFilesPrefix warns and returns '' — meaning all JS-valid env keys are exposed without any prefix, since there is no usable filter.","triggerScenarios":"quasar dev/build with env.prefix as an array whose entries are all falsy or all fail validEnvKeyRE (e.g. prefix: ['x-y_', '']) and defaultPrefix is '' (backendPrefix default); called from prefix/clientPrefix/backendPrefix getters.","commonSituations":"Every entry mistyped with invalid characters, an array of empty strings, or config edited down to invalid placeholders during debugging.","solutions":["Add at least one valid prefix entry (valid JS identifier) to the array.","If exposing everything is intended, replace the array with prefix: '' or remove the option and document the choice.","Verify .env variable naming matches the final prefix decision."],"exampleFix":"// before (quasar.config)\nenv: { prefix: ['a-b_', ''] }\n// after\nenv: { prefix: ['MYAPP_', 'CLIENT1_'] }","handlingStrategy":"validation","validationCode":"const validEnvKeyRE = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/\nconst list = conf.env?.prefix\nif (Array.isArray(list) && !list.some(e => e && validEnvKeyRE.test(e))) {\n  throw new Error('env.prefix array has no valid entries')\n}","typeGuard":"function hasValidPrefixEntry(v) {\n  return Array.isArray(v) && v.some(e => typeof e === 'string' && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e))\n}","tryCatchPattern":null,"preventionTips":["After editing a prefix array, verify at least one entry survives /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.","If exposing all env keys is deliberate, express that by removing the option, not by an array of invalid values.","Review env config in code review whenever .env naming changes."],"tags":["env","config","array"],"backgroundTag":"invalid-env-prefix","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}