{"record":{"id":"72dd7ac000439ab4","repo":"saadeghi/daisyui","slug":"unsupported-daisyui-source-file-sourcefile","errorCode":null,"errorMessage":"Unsupported daisyUI source file: ${sourceFile}","messagePattern":"Unsupported daisyUI source file: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playground/build-daisyui.js","lineNumber":36,"sourceCode":"    { type: \"base\", outputRoot: resolve(daisyuiRoot, \"theme\"), themes: true },\n  ],\n  [\n    resolve(daisyuiRoot, \"src/utilities\"),\n    { type: \"utility\", outputRoot: resolve(daisyuiRoot, \"utilities\") },\n  ],\n])\n\nconst inputFile = process.argv[2]\n\nif (!inputFile) {\n  throw new Error(\"A daisyUI source file is required\")\n}\n\nconst sourceFile = resolve(inputFile)\nconst sourceGroup = sourceGroups.get(dirname(sourceFile))\n\nif (!sourceGroup || !sourceFile.endsWith(\".css\")) {\n  throw new Error(`Unsupported daisyUI source file: ${sourceFile}`)\n}\n\nconst name = basename(sourceFile, \".css\")\nconst [styles, outputDirectory] = await Promise.all([\n  cssToJs(sourceFile),\n  createDirectoryBasedOnFileNames(name, \".css\", sourceGroup.outputRoot),\n])\n\nawait createPluginFiles(sourceGroup.type, outputDirectory, styles, name)\n\nif (sourceGroup.themes) {\n  await generateThemesObject(resolve(daisyuiRoot, \"theme/object.js\"))\n}\n","sourceCodeStart":18,"sourceCodeEnd":50,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/playground/build-daisyui.js#L18-L50","documentation":"After resolving the input, the script looks up sourceGroups by dirname(sourceFile). It only knows four directories: src/base, src/components, src/themes, and src/utilities (all under packages/daisyui). It throws when the dirname is not one of those, or when the file does not end in .css.","triggerScenarios":"Passing a file outside the four known src/ subdirectories; passing a .js/.scss/.html file; passing a generated output file (e.g. under packages/daisyui/base instead of src/base); passing a docs or playground CSS file.","commonSituations":"Contributor edits a generated file in components/ instead of the source in src/components/; passing an absolute path whose resolved dirname does not exactly match the canonical resolved source-group path; a typo in the subdirectory name.","solutions":["Move/edit the file under packages/daisyui/src/{base,components,themes,utilities}/.","Make sure the extension is exactly .css.","If using a relative path, run the script from a directory where it resolves into one of the four src/ folders."],"exampleFix":"// before\nbun packages/playground/build-daisyui.js packages/daisyui/components/button.css\n// after\nbun packages/playground/build-daisyui.js packages/daisyui/src/components/button.css","handlingStrategy":"validation","validationCode":"import { dirname, resolve } from 'node:path'\nconst daisyuiRoot = resolve(projectRoot, '../daisyui')\nconst allowedDirs = new Set(['base','components','themes','utilities'].map(s => resolve(daisyuiRoot, 'src', s)))\nconst ok = allowedDirs.has(dirname(resolve(inputFile))) && inputFile.endsWith('.css')\nif (!ok) { console.error('File must be a .css under packages/daisyui/src/{base,components,themes,utilities}'); process.exit(2) }","typeGuard":"const isAllowedSource = (file) => file.endsWith('.css') && allowedDirs.has(dirname(resolve(file)))","tryCatchPattern":null,"preventionTips":["Edit sources only under packages/daisyui/src/{base,components,themes,utilities}.","Use tab-completion to confirm the exact subdirectory name.","Remember generated output lives in sibling folders (base/, components/, ...) - never edit those."],"tags":["cli","build","path","daisyui"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}