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

  1. Convert the extras to flagged options (--html/--css) or remove them.
  2. Quote/guard shell globs so they do not expand unexpectedly.
  3. 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

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


AI-assisted analysis of saadeghi/daisyui@42b09e637e (2026-08-13). Data as JSON: /api/errors/fa05dcb182f1f303. Report an issue: GitHub.