quasarframework/quasar · warning
quasar.config file > invalid Vite plugin specified: ${name}
Error message
quasar.config file > invalid Vite plugin specified: ${name} What it means
quasar.config's build.vite.plugins array accepts entries of the form `'plugin-name'`, `['plugin-name', opts]`, `pluginFn` or `[pluginFn, opts]`. During Vite config parsing, if a plugin entry's name part is neither a string nor a plugin function (e.g. a plain object, number, or nested array), the CLI warns and skips that plugin, leaving it out of the build.
Source
Thrown at app-vite/lib/config-tools.js:76
if (typeof name === 'function') {
acc.push(
// protect against the Vite plugin mutating its own options and triggering endless cfg diff loop
name(merge({}, pluginOpts))
)
continue
}
if (Object(name) === name) {
acc.push(
// protect against the Vite plugin mutating its own options and triggering endless cfg diff loop
merge({}, name)
)
continue
}
if (typeof name !== 'string') {
warn('quasar.config file > invalid Vite plugin specified: ' + name)
warn(
"Correct form: [ 'my-vite-plugin-name', { /* pluginOpts */ } ] or [ pluginFn, { /* pluginOpts */ } ]"
)
continue
}
const plugin = await getPackage(name, appDir)
if (!plugin) {
warn(
'quasar.config file > invalid Vite plugin specified (cannot find it): ' +
name
)
continue
}
const pluginFn =
plugin.default?.default || // example: vite-plugin-checkerView on GitHub (pinned to 4841521b5f)
Solutions
- Use the string form: `plugins: ['my-vite-plugin-name']` or `[['my-vite-plugin-name', { opts }]]` for options.
- If using the function form, pass the plugin function itself: `plugins: [myPluginFn]` or `[[myPluginFn, { opts }]]`.
- Check the warning's trailing value — it prints the offending entry; fix that entry's type (a plugin object imported from a package is not valid here).
Example fix
// before (quasar.config > build > vite > plugins)
plugins: [vue(), ['legacy', {}]]
// after
plugins: ['vue', ['legacy', {}]] Defensive patterns
Strategy: validation
Validate before calling
const isValidEntry = e =>
typeof e === 'string' ||
typeof e === 'function' ||
(Array.isArray(e) && (typeof e[0] === 'string' || typeof e[0] === 'function'));
// before build, in quasar.config or a wrapper:
plugins.forEach(e => { if (!isValidEntry(e)) throw new Error(`bad plugin entry: ${JSON.stringify(e)}`); }); Type guard
function isPluginEntry(e) {
return typeof e === 'string' || typeof e === 'function' ||
(Array.isArray(e) && (typeof e[0] === 'string' || typeof e[0] === 'function'));
} Prevention
- Never copy plain-Vite `plugins: [pluginObject()]` into quasar.config — use the plugin's name string.
- Only nest one level: `['name', { opts }]`, not `[['name']]`.
- Import plugin functions only when intentionally using the function form.
When it happens
Trigger: parseVitePlugins encounters an entry whose name is not a string (and not a valid function form) — e.g. `plugins: [['vue', {}]]` (double-nested array) or `plugins: [{ plugin }]` (config-tools.js:76).
Common situations: Copy-pasting a plain Vite config's plugins array directly into quasar.config (plain Vite accepts plugin objects, Quasar's string-form requires names); over-nesting arrays; typos that turn a string into something else; spreading a plugin object into the array.
Related errors
- Correct form: [ 'my-vite-plugin-name', { /* pluginOpts */ }
- Build output directory must be a non-empty path
- Project directory must be a non-empty path
- Invalid SSR nonce. Expected a non-empty base64 or base64url
- The queued task for "${task.diffName}" failed
AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30).
Data as JSON: /api/errors/6dc85637cd8d92d4.
Report an issue: GitHub.