{"record":{"id":"85691e2f5cf40020","repo":"quasarframework/quasar","slug":"quasar-id-contains-an-import-from-quasar","errorCode":null,"errorMessage":"[Quasar] \"${id}\" contains an import from \"quasar\" that could not be transformed into per-file imports, so the full Quasar bundle may end up in your build output","messagePattern":"\\[Quasar\\] \"(.+?)\" contains an import from \"quasar\" that could not be transformed into per-file imports, so the full Quasar bundle may end up in your build output","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"vite-plugin/src/plugin.js","lineNumber":138,"sourceCode":"  const vueMatcher = createExtMatcher(opts.autoImportVueExtensions)\n  const scriptMatcher = createExtMatcher(opts.autoImportScriptExtensions)\n\n  const warnedFiles = new Set()\n\n  function warnResidualImports(ctx, code, id) {\n    if (\n      useTreeshaking &&\n      !warnedFiles.has(id) &&\n      hasResidualQuasarImports(code, id)\n    ) {\n      warnedFiles.add(id)\n      const msg =\n        `[Quasar] \"${id}\" contains an import from \"quasar\" that could not be` +\n        ' transformed into per-file imports, so the full Quasar bundle may' +\n        ' end up in your build output'\n\n      if (ctx !== void 0 && typeof ctx.warn === 'function') {\n        ctx.warn(msg)\n      } else {\n        console.warn(msg)\n      }\n    }\n  }\n\n  function transformHandler(src, id) {\n    // when hook filters are not available, this mirrors their fast bail out\n    if (!quasarCodeRegex.test(src)) {\n      return null\n    }\n\n    const is = parseViteRequest(id)\n\n    // the regex fallback post-processes the compiled render code,\n    // so template requests need their own handling there\n    if (astAutoImportActive === false && is.template(vueMatcher)) {\n      const code = vueTransform(","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/vite-plugin/src/plugin.js#L120-L156","documentation":"The Quasar vite-plugin transforms bare 'quasar' imports into per-file imports for tree-shaking. warnResidualImports is invoked from the transform pipeline when, after transformation, a module still contains imports from 'quasar' that could not be resolved to per-file imports; it reports through Rollup's this.warn() when a transform context is available. The build continues, but the full Quasar bundle may be pulled into the output, inflating bundle size.","triggerScenarios":"A project file (id) imports from 'quasar' in a way the transformer cannot statically rewrite (dynamic imports, re-exports through non-analyzable code, or imports from dependencies bundling quasar), and the plugin has a Rollup/NormalizedName context to warn through.","commonSituations":"Importing quasar dynamically (`await import('quasar')`), importing from a library that itself re-exports quasar, or config options that bypass auto-import component/style transforms.","solutions":["Change the offending import to explicit per-file imports, e.g. import { QBtn } from 'quasar' (statically analyzable named imports)","Check the plugin configuration (quasar vite-plugin options/auto-import settings) so components/directives/styles are covered","Inspect the file named in the message and remove dynamic/ambiguous quasar imports; if intentional, accept the warning knowing full-bundle cost"],"exampleFix":"// before\nconst QBtn = (await import('quasar')).QBtn\n// after\nimport { QBtn } from 'quasar'\n// or use quasar/wrappers per-component pattern per plugin docs","handlingStrategy":"validation","validationCode":"// build-time guard: fail the build on residual quasar imports\nexport default defineConfig(({ vite }) => ({\n  build: { rollupOptions: {\n    onwarn(warning, warn) {\n      if (warning.code === 'PLUGIN_WARNING' && /could not be\\s+transformed into per-file imports/.test(warning.message)) {\n        throw new Error('Residual quasar import: ' + warning.message)\n      }\n      warn(warning)\n    }\n  }}\n}))","typeGuard":null,"tryCatchPattern":"try {\n  await build(config)\n} catch (e) {\n  if (/could not be transformed into per-file imports/.test(String(e))) {\n    console.error('Fix dynamic quasar imports to named static imports')\n  }\n  throw e\n}","preventionTips":["Use static named imports from 'quasar' only","Avoid dynamic import('quasar') and wildcard re-exports","Audit bundle output size regularly to catch full-bundle regressions"],"tags":["vite-plugin","tree-shaking","bundle-size","import-transform"],"backgroundTag":"untransformed-quasar-import","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}