{"record":{"id":"6c5786daff5e73b7","repo":"quasarframework/quasar","slug":"unknown-import-from-quasar-importname","errorCode":null,"errorMessage":"Unknown import from Quasar: ${importName}","messagePattern":"Unknown import from Quasar: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"vite-plugin/src/js-transform.js","lineNumber":149,"sourceCode":"      node.source?.value === 'quasar' &&\n      !isTypeOnlyNode(node)\n    ) {\n      return true\n    }\n  }\n\n  // dynamic import(\"quasar\") can appear anywhere, but the full AST\n  // walk is only worth it when its textual form is present at all\n  return (\n    dynamicResidualRegex.test(code) &&\n    containsQuasarDynamicImport(program.body) === true\n  )\n}\n\nexport function importTransformation(importName) {\n  const file = quasarImportMap[importName]\n  if (file === void 0) {\n    throw new Error('Unknown import from Quasar: ' + importName)\n  }\n  return 'quasar/' + file\n}\n\nfunction countNewlines(str) {\n  let acc = 0\n  let index = -1\n\n  while ((index = str.indexOf('\\n', index + 1)) !== -1) {\n    acc++\n  }\n\n  return acc\n}\n\n/**\n * Transforms JS code where importing from 'quasar' package\n * Example:","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/vite-plugin/src/js-transform.js#L131-L167","documentation":"importTransformation() looks up the imported name in Quasar's import map to rewrite `import { X } from 'quasar'` into a direct deep import (`quasar/<file>`). If the name isn't in the map — i.e. it isn't a real Quasar export — it throws 'Unknown import from Quasar'. This surfaces typos or imports of removed/renamed Quasar exports at build time instead of as runtime undefineds.","triggerScenarios":"Writing `import { QButon } from 'quasar'` (typo); importing an export removed/renamed in your Quasar version (e.g. an old component name); importing something that exists at runtime but is absent from the installed import-map.json (stale quasar package vs newer plugin expectations).","commonSituations":"Upgrading Quasar where an export was renamed or dropped; copy-pasted code from an old tutorial; IDE auto-import suggesting a non-existent name; mixing a locally built quasar dist with an older import map.","solutions":["Check the spelling against Quasar's docs — most cases are typos (QBtn, QDialog, useQuasar, etc.).","Verify the export exists in your installed version: search `node_modules/quasar/dist/transforms/import-map.json` for the name; if absent it isn't exported by that version.","If migrating, update removed/renamed imports per the Quasar upgrade guide to the current names.","If the name should exist, refresh the quasar package (clean reinstall) so import-map.json matches your plugin version."],"exampleFix":"// before\nimport { QLayoutHeader } from 'quasar'\n\n// after (QLayoutHeader was removed; use QHeader/QToolbar inside QLayout)\nimport { QHeader, QToolbar } from 'quasar'","handlingStrategy":"validation","validationCode":"import { readFileSync } from 'node:fs'\nconst map = JSON.parse(readFileSync('node_modules/quasar/dist/transforms/import-map.json', 'utf8'))\nif (map[importName] === undefined) {\n  console.warn(`'${importName}' is not exported by the installed quasar version`)\n}","typeGuard":"function isQuasarExport(importName, map) {\n  return Object.prototype.hasOwnProperty.call(map, importName)\n}","tryCatchPattern":"try {\n  build()\n} catch (err) {\n  const m = /Unknown import from Quasar: (.+)/.exec(err.message)\n  if (m) {\n    console.error(`Fix the import '${m[1]}' — check spelling or the Quasar upgrade guide`)\n    process.exitCode = 1\n  } else throw err\n}","preventionTips":["Let the IDE auto-import from 'quasar' rather than typing component names by hand.","After upgrading Quasar, diff your quasar imports against the changelog for renames/removals.","Cross-check uncertain names in node_modules/quasar/dist/transforms/import-map.json.","Keep quasar and the vite plugin on compatible versions so the map matches the runtime exports."],"tags":["vite-plugin","import","build-time","tree-shaking"],"backgroundTag":"unknown-export-import","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}