saadeghi/daisyui · error · Error
Too many positional arguments
Error message
Too many positional arguments
What it means
After assigning the first positional to HTML and the second to CSS, any remaining positional token is rejected. The script accepts at most two bare positional arguments.
Source
Thrown at packages/tailwind-play-share/index.mjs:124
positional.push(argument)
}
}
if (options.html !== undefined && options.htmlFile !== undefined) {
throw new Error("Use either --html or --html-file, not both")
}
if (options.css !== undefined && options.cssFile !== undefined) {
throw new Error("Use either --css or --css-file, not both")
}
if (options.html === undefined && options.htmlFile === undefined && positional.length > 0) {
options.html = positional.shift()
}
if (options.css === undefined && options.cssFile === undefined && positional.length > 0) {
options.css = positional.shift()
}
if (positional.length > 0) {
throw new Error("Too many positional arguments")
}
return options
}
async function readStdin() {
let input = ""
for await (const chunk of process.stdin) {
input += chunk
}
return input
}
async function resolveInput(options) {
let html = options.html
let css = options.css
if (options.htmlFile !== undefined) {View on GitHub (pinned to 42b09e637e)
Solutions
- Convert the extras to flagged options (--html/--css) or remove them.
- Quote/guard shell globs so they do not expand unexpectedly.
- Move extra arguments after `--` only if they are truly meant as HTML/CSS content.
Example fix
# before bun .../index.mjs '<div/>' '@import "tailwindcss";' extra # after bun .../index.mjs '<div/>' '@import "tailwindcss";'
Defensive patterns
Strategy: validation
Validate before calling
// After assigning html/css from positionals, reject leftovers.
if (positional.length > 0) {
throw new Error(`Too many positional arguments: ${positional.join(' ')}`)
} Prevention
- Use flags for anything beyond the first two positional tokens.
- Quote shell arguments to prevent unintended glob expansion.
- Keep the positional form to exactly html then css.
When it happens
Trigger: Three or more positional tokens on the command line, e.g. `index.mjs a b c`.
Common situations: Forgetting to flag later arguments; a shell glob expanding into multiple tokens; passing extra args meant for another tool.
Related errors
- ${flag} requires a value
- Unknown option: ${argument}
- A daisyUI source file is required
- --timeout must be a positive number of milliseconds
- Use either --html or --html-file, not both
AI-assisted analysis of saadeghi/daisyui@42b09e637e (2026-08-13).
Data as JSON: /api/errors/fa05dcb182f1f303.
Report an issue: GitHub.