{"record":{"id":"2b9bf4fa537454db","repo":"quasarframework/quasar","slug":"quasar-in-your-vite-config-file-please-add-the","errorCode":null,"errorMessage":"[Quasar] In your Vite config file, please add the Quasar plugin ** after ** the Vue one","messagePattern":"\\[Quasar\\] In your Vite config file, please add the Quasar plugin \\*\\* after \\*\\* the Vue one","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"vite-plugin/src/plugin.js","lineNumber":51,"sourceCode":"\n  for (const key of defaultOptionsKeys) {\n    if (opts[key] === void 0) {\n      opts[key] = defaultOptions[key]\n    }\n  }\n\n  return opts\n}\n\nfunction getConfigPlugin(opts) {\n  return {\n    name: 'vite:quasar:vite-conf',\n\n    configResolved(viteConf) {\n      const vueCfg = viteConf.plugins.find(entry => entry.name === 'vite:vue')\n\n      if (vueCfg === void 0) {\n        throw new Error(\n          '[Quasar] In your Vite config file, please add the Quasar plugin ** after ** the Vue one'\n        )\n      }\n    },\n\n    config(viteConf, { command }) {\n      return getViteConfig(\n        opts.runMode,\n        command === 'serve',\n        viteConf,\n        opts.sassVariables\n      )\n    }\n  }\n}\n\nconst scssMatcher = createExtMatcher(['scss', 'module.scss'])\nconst sassMatcher = createExtMatcher(['sass', 'module.sass'])","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/vite-plugin/src/plugin.js#L33-L69","documentation":"Quasar's Vite plugin patches Vue's template compiler (config injected by the vue plugin) and therefore must run AFTER the Vue plugin in the plugins array. In configResolved it searches for a plugin named 'vite:vue' and throws this error if it isn't found, which almost always means the Quasar plugin was listed before Vue (so Vue's resolved config hadn't registered yet) or Vue's plugin is missing entirely.","triggerScenarios":"vite.config.js exporting plugins: [quasar(), vue()] (wrong order); the Vue plugin installed under a name the check can't find (very old @vitejs/plugin-vue); forgetting to add vue() altogether while using Quasar's plugin.","commonSituations":"Manually wiring Quasar into a Vite config (or migrating a non-Quasar project) and placing quasar() first; copying a config snippet where plugin order got rearranged; upgrading @vitejs/plugin-vue to a version with a different internal name.","solutions":["Reorder plugins so Quasar comes after Vue: `plugins: [vue(), quasar()]`.","Confirm @vitejs/plugin-vue is installed and actually invoked in the plugins array (not just imported).","If using a framework preset that injects plugins dynamically, ensure quasar() isn't prepended before the preset's vue() call."],"exampleFix":"// before (vite.config.js)\nplugins: [quasar(), vue()]\n\n// after\nplugins: [vue(), quasar()]","handlingStrategy":"validation","validationCode":"// static sanity check for your vite config\nconst plugins = [vue(), quasar()]\nconst qIdx = plugins.findIndex(p => p && p.name === 'vite:quasar:vite-conf')\nconst vIdx = plugins.findIndex(p => p && p.name === 'vite:vue')\nif (vIdx === -1 || (qIdx !== -1 && qIdx < vIdx)) {\n  throw new Error('Quasar plugin must come AFTER the Vue plugin')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Memorize the order: plugins: [vue(), quasar()] — Vue first, Quasar second.","When using config presets that inject plugins, append quasar() last.","After editing vite.config, run a quick `vite build` to fail fast on ordering mistakes.","Keep @vitejs/plugin-vue current so its internal 'vite:vue' name matches what Quasar's check expects."],"tags":["vite-plugin","vite-config","plugin-order","configuration"],"backgroundTag":"vite-plugin-order","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}