quasarframework/quasar · critical
The quasar.config file does not default exports an Object. P
Error message
The quasar.config file does not default exports an Object. Please fix it.
What it means
#computeConfig calls the default-exported function and requires it to return an Object (`Object(userCfg) === userCfg`); if the result is a primitive, null or undefined, Quasar reports this message. Fatal when shouldFail, otherwise a warning that aborts config computation.
Source
Thrown at app-vite/lib/quasar-config-file.js:792
'The quasar.config file has runtime errors.' +
' Please check the Node.js stack above against the' +
` temporarily created ${basename(this.#tempFile)} file` +
' then DELETE it ("quasar clean --qconf" can be used).'
if (this.#shouldFail) fatal(msg, 'FAIL')
warn(msg + ' Please fix the errors in the original file.\n')
return
}
fse.removeSync(this.#tempFile)
if (Object(userCfg) !== userCfg) {
const msg = 'The quasar.config file does not default exports an Object.'
if (this.#shouldFail) fatal(msg, 'FAIL')
warn(msg + ' Please fix it.\n')
return
}
const { appPaths } = this.#ctx
let rawQuasarConf = merge(
{
ctx: this.#ctx,
boot: [],
css: [],
extras: [],
animations: [],
framework: {
components: [],
directives: [],
plugins: [],View on GitHub (pinned to 4841521b5f)
Solutions
- Make the exported function return a config object on every code path.
- Verify braces/arrow syntax: `configure(ctx => ({ ... }))` vs `configure(ctx => { return { ... } })`.
- Remove accidental `return;` or null returns in conditional branches.
- Log the function result in isolation (`node -e`) to confirm it's an object.
Example fix
// before
export default configure(function (ctx) {
build: { vitePlugins: [] } // no return; object literal not returned
})
// after
export default configure(function (ctx) {
return { build: { vitePlugins: [] } }
}) Defensive patterns
Strategy: type-guard
Validate before calling
const mod = await import('./quasar.config.js')
const cfg = mod.default({ dev: true })
if (Object(cfg) !== cfg) {
throw new Error('quasar.config function must return an object')
} Type guard
function returnsObject(fn) {
return Object(fn({ dev: true })) === fn({ dev: true })
} Prevention
- Ensure every branch of the configure function returns a config object.
- Prefer the single-expression arrow form: configure(ctx => ({ ... })).
- Add a temporary console.log of the returned value when refactoring config.
- Keep conditional config generation small and reviewed.
When it happens
Trigger: The quasar.config default-export function returns a non-object: returns nothing, returns a string/number/boolean, returns a promise without await, or `configure()` was bypassed with a function returning null.
Common situations: Forgot the `return` statement inside configure(function (ctx) { ... }); conditional branches where every path doesn't return an object; copying a snippet whose arrow function body is `=> { ... }` without return.
Related errors
- The default export value of the quasar.config file is not a
- Build output directory must be a non-empty path
- Project directory must be a non-empty path
- Refusing to remove the project root as build output
- Build output directory must remain inside the project. Set b
AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30).
Data as JSON: /api/errors/5497122400678963.
Report an issue: GitHub.