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

  1. Make the exported function return a config object on every code path.
  2. Verify braces/arrow syntax: `configure(ctx => ({ ... }))` vs `configure(ctx => { return { ... } })`.
  3. Remove accidental `return;` or null returns in conditional branches.
  4. 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

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


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