{"record":{"id":"c07c658f79392843","repo":"quasarframework/quasar","slug":"the-default-export-value-of-the-quasar-config-file","errorCode":null,"errorMessage":"The default export value of the quasar.config file is not a function. Please fix it.","messagePattern":"The default export value of the quasar\\.config file is not a function\\. Please fix it\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"app-vite/lib/quasar-config-file.js","lineNumber":761,"sourceCode":"        'FAIL'\n      )\n    }\n\n    await bundle.close()\n  }\n\n  // exits process on first build, otherwise\n  // returns undefined if it encounters errors\n  async #computeConfig(quasarConfigFn) {\n    if (typeof quasarConfigFn !== 'function') {\n      fse.removeSync(this.#tempFile)\n\n      const msg =\n        'The default export value of the quasar.config file is not a function.'\n\n      if (this.#shouldFail) fatal(msg, 'FAIL')\n\n      warn(msg + ' Please fix it.\\n')\n      return\n    }\n\n    let userCfg\n\n    try {\n      userCfg = await quasarConfigFn(this.#ctx)\n    } catch (err) {\n      console.log()\n      console.error(err)\n\n      const msg =\n        'The quasar.config file has runtime errors.' +\n        ' Please check the Node.js stack above against the' +\n        ` temporarily created ${basename(this.#tempFile)} file` +\n        ' then DELETE it (\"quasar clean --qconf\" can be used).'\n\n      if (this.#shouldFail) fatal(msg, 'FAIL')","sourceCodeStart":743,"sourceCodeEnd":779,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/quasar-config-file.js#L743-L779","documentation":"#computeConfig validates that quasar.config's default export is a function (Quasar's configure() wrapper); if not, it reports this message. When shouldFail it is fatal; otherwise it warns and skips config computation, so the command cannot proceed with a valid config.","triggerScenarios":"quasar.config file's default export is not a function — e.g. `export default { ... }` (object) instead of `export default configure(() => ({...}))`, or a plain `module.exports = {...}` in CJS without a function default.","commonSituations":"Migrating a project from an older config format (quasar.conf.js exporting an object) to quasar.config file without wrapping in configure(); hand-written config copied from non-Quasar docs; AI/manual edit rewriting the export incorrectly.","solutions":["Wrap the returned object in configure(): `export default configure(function (ctx) { return { ... } })`.","Ensure the function returns the config object (not nothing).","If converting from quasar.conf.js, follow the official migration to the quasar.config file format.","Check the default export exists at all (only `export default` counts)."],"exampleFix":"// before\nexport default {\n  framework: { plugins: ['Notify'] }\n}\n// after\nimport { configure } from 'quasar/wrappers'\nexport default configure(function (ctx) {\n  return { framework: { plugins: ['Notify'] } }\n})","handlingStrategy":"type-guard","validationCode":"// After loading the module:\nconst mod = await import('./quasar.config.js')\nif (typeof mod.default !== 'function') {\n  throw new Error('quasar.config default export must be a function')\n}","typeGuard":"function isConfigureExport(v) {\n  return typeof v === 'function'\n}","tryCatchPattern":null,"preventionTips":["Always scaffold config via `export default configure(function (ctx) { return {...} })`.","Never export a plain object from quasar.config.","Diff against a fresh project's quasar.config when migrating from quasar.conf.js.","Run `quasar dev` after any config migration to catch shape errors early."],"tags":["config","default-export","shape-mismatch"],"backgroundTag":"invalid-config-export","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}