quasarframework/quasar · info
No env prefix specified, using default "${defaultPrefix}" in
Error message
No env prefix specified, using default "${defaultPrefix}" instead. What it means
getEnvFilesPrefix resolves which prefix filters which .env files' variables are exposed. When the configured prefix is falsy (undefined/empty) but the caller supplies a defaultPrefix, it warns and falls back to that default instead of silently exposing nothing.
Source
Thrown at app-vite/lib/utils/env.js:48
/**
* Filter out keys that cannot be used in JS
* as import.meta.env.[key]
* Examples: ProgramFiles(x86), BASH_FUNC_which%%
*
* Also, avoid sub-deps changing process.env, resulting
* in restarts of the devserver watching for config changes...
*/
const processEnv = Object.keys(process.env)
.filter(key => validEnvKeyRE.test(key))
.reduce((acc, key) => {
acc[key] = process.env[key]
return acc
}, {})
function getEnvFilesPrefix({ prefix, defaultPrefix, banner }) {
if (!prefix) {
if (!defaultPrefix) return ''
warn(
`No env prefix specified, using default "${defaultPrefix}" instead.`,
banner
)
return defaultPrefix
}
if (!Array.isArray(prefix)) {
if (!validEnvKeyRE.test(prefix)) {
if (!defaultPrefix) {
warn(
`The "${prefix}" env prefix is invalid in JS. Allowing all env keys that are valid in JS (without any prefix).`,
banner
)
return ''
}
warn(
`Invalid env prefix specified, using default "${defaultPrefix}" instead.`,View on GitHub (pinned to 4841521b5f)
Solutions
- Set quasar.config > env > prefix explicitly (e.g. prefix: 'MY_APP_') to silence the warning and control exposure.
- If the default is acceptable, no action needed — it is informational only.
- To expose nothing, set prefix to a non-empty unlikely string rather than empty.
Example fix
// before (quasar.config)
env: { prefix: undefined }
// after
env: { prefix: 'MYAPP_' } Defensive patterns
Strategy: validation
Validate before calling
// in quasar.config
if (!conf.env?.prefix) console.warn('env.prefix not set; default prefix will be used') Type guard
function hasEnvPrefix(conf) {
return typeof conf?.env?.prefix === 'string' && conf.env.prefix.length > 0 || Array.isArray(conf?.env?.prefix)
} Prevention
- Always declare env.prefix explicitly in quasar.config.
- Decide team-wide on one prefix convention (uppercase + trailing underscore).
When it happens
Trigger: quasar dev/build when quasar.config > env > prefix is omitted/empty while a default prefix applies (e.g. client builds defaulting to 'QCLI_'); getEnvFilesPrefix is called by the prefix, clientPrefix and backendPrefix getters.
Common situations: Upgrading Quasar where env prefix handling changed, deleting the env prefix option while relying on old behavior, or a typo like prefix: '' meaning to disable it.
Related errors
- The "${prefix}" env prefix is invalid in JS. Allowing all en
- Invalid env prefix specified, using default "${defaultPrefix
- Invalid env prefix "${entry}" specified in the array. Skippi
- No valid env prefix specified in the array. Allowing all env
- Build output directory must be a non-empty path
AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30).
Data as JSON: /api/errors/ee4d2008ad1575c4.
Report an issue: GitHub.