{"record":{"id":"f6aa02af7c92fd92","repo":"saadeghi/daisyui","slug":"a-daisyui-source-file-is-required","errorCode":null,"errorMessage":"A daisyUI source file is required","messagePattern":"A daisyUI source file is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playground/build-daisyui.js","lineNumber":29,"sourceCode":"  [resolve(daisyuiRoot, \"src/base\"), { type: \"base\", outputRoot: resolve(daisyuiRoot, \"base\") }],\n  [\n    resolve(daisyuiRoot, \"src/components\"),\n    { type: \"component\", outputRoot: resolve(daisyuiRoot, \"components\") },\n  ],\n  [\n    resolve(daisyuiRoot, \"src/themes\"),\n    { 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) {","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/playground/build-daisyui.js#L11-L47","documentation":"build-daisyui.js expects exactly one CLI argument: the path to a daisyUI source CSS file. It reads process.argv[2] and throws immediately when that value is falsy. The script then maps the file to one of four source groups, so without an argument it cannot proceed.","triggerScenarios":"Running `bun packages/playground/build-daisyui.js` (or `node ...`) with no positional argument, or with argv stripped by a wrapper.","commonSituations":"A new contributor runs the build script directly without reading its usage; a npm/script entry forgets to forward the file path; CI invokes the script in a step that passes no argument.","solutions":["Pass the source CSS file path as the first argument.","If calling from a script, ensure the file path is forwarded as process.argv[2].","Run with no args only if you meant a different entry point."],"exampleFix":"// before\nbun packages/playground/build-daisyui.js\n// after\nbun packages/playground/build-daisyui.js packages/daisyui/src/components/button.css","handlingStrategy":"validation","validationCode":"const inputFile = process.argv[2]\nif (!inputFile) {\n  console.error('Usage: build-daisyui.js <packages/daisyui/src/.../file.css>')\n  process.exit(2)\n}","typeGuard":"const isNonEmptyString = (v) => typeof v === 'string' && v.length > 0","tryCatchPattern":null,"preventionTips":["Always invoke the script with a source file path.","In npm/scripts entries, forward the file via \"$1\" or a named variable.","Print usage on missing argv in your own wrapper."],"tags":["cli","build","argument","daisyui"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}