{"record":{"id":"7dca091e38fff959","repo":"quasarframework/quasar","slug":"failed-to-load-quasar-auto-import-data","errorCode":null,"errorMessage":"Failed to load Quasar auto-import data","messagePattern":"Failed to load Quasar auto-import data","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"vite-plugin/src/auto-import-data.js","lineNumber":18,"sourceCode":"import { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\nimport { quasarPath } from './quasar-path.js'\n\nlet autoImportData\n\nexport function loadAutoImportData() {\n  if (autoImportData === void 0) {\n    try {\n      autoImportData = JSON.parse(\n        readFileSync(\n          join(quasarPath, 'dist/transforms/auto-import.json'),\n          'utf8'\n        )\n      )\n    } catch (err) {\n      throw new Error('Failed to load Quasar auto-import data', { cause: err })\n    }\n  }\n\n  return autoImportData\n}\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/vite-plugin/src/auto-import-data.js#L1-L24","documentation":"The Quasar Vite plugin loads Quasar's component/directive auto-import metadata from `<quasar package>/dist/transforms/auto-import.json`. If that read/parse fails (missing file, unreadable path, corrupted JSON, or the quasar package itself unresolvable), it rethrows as 'Failed to load Quasar auto-import data' with the original error as `cause`. Without this data the plugin cannot rewrite `import { QBtn } from 'quasar'` style imports.","triggerScenarios":"Running vite dev/build when the installed quasar package lacks dist/transforms/auto-import.json — broken or partial install (interrupted pnpm/npm install), corrupted node_modules, quasar resolution picking the wrong path, or a version mismatch where the installed quasar build doesn't ship transforms.","commonSituations":"Fresh clone where dependencies installed partially; CI cache that stashed a truncated quasar package; deleting/rebuilding node_modules mid-run; using a patched or hoisted monorepo layout where `quasar` resolves unexpectedly.","solutions":["Reinstall dependencies cleanly: delete node_modules and the lockfile entries for quasar, then `pnpm install` (or `npm ci`).","Verify the file exists: check `node_modules/quasar/dist/transforms/auto-import.json`; if missing, the quasar package is broken.","Ensure the `quasar` package version matches the vite-plugin version expected by your app-vite version (mismatched majors can change shipped files).","Inspect `err.cause` in the stack — it names the real failure (ENOENT vs JSON syntax) to pinpoint whether it's a missing file or corruption."],"exampleFix":"# before: broken install\nError: Failed to load Quasar auto-import data (ENOENT .../quasar/dist/transforms/auto-import.json)\n\n# after\nrm -rf node_modules && pnpm install","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nconst require = createRequire(import.meta.url)\nconst quasarPath = require.resolve('quasar').replace(/([\\\\/])dist([\\\\/]).*$/, '')\nif (!existsSync(`${quasarPath}/dist/transforms/auto-import.json`)) {\n  console.error('quasar package is broken: auto-import.json missing; reinstall dependencies')\n}","typeGuard":null,"tryCatchPattern":"try {\n  await viteBuild()\n} catch (err) {\n  if (err.message === 'Failed to load Quasar auto-import data') {\n    console.error('Quasar install broken; run: rm -rf node_modules && pnpm install', { cause: err.cause })\n  } else throw err\n}","preventionTips":["Use a lockfile and `npm ci`/frozen pnpm installs so node_modules is never partially populated.","Avoid caching node_modules across CI runs without integrity checks.","Keep quasar and @quasar/vite-plugin versions in lockstep.","When the error appears, read err.cause — ENOENT means reinstall, JSON parse error means corruption."],"tags":["vite-plugin","auto-import","installation","node-modules"],"backgroundTag":"missing-generated-file","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}