{"record":{"id":"3811287f23bee92e","repo":"saadeghi/daisyui","slug":"provide-html-css-using-arguments-files-or-json-o","errorCode":null,"errorMessage":"Provide HTML/CSS using arguments, files, or JSON on stdin","messagePattern":"Provide HTML/CSS using arguments, files, or JSON on stdin","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":164,"sourceCode":"    css = await readFile(resolve(options.cssFile), \"utf8\")\n  }\n\n  if (html === undefined && css === undefined && !process.stdin.isTTY) {\n    const stdin = (await readStdin()).trim()\n    if (stdin) {\n      let parsed\n      try {\n        parsed = JSON.parse(stdin)\n      } catch (error) {\n        throw new Error(`stdin must be JSON with html and css strings: ${error.message}`)\n      }\n      html = parsed.html\n      css = parsed.css\n    }\n  }\n\n  if (html === undefined && css === undefined) {\n    throw new Error(\"Provide HTML/CSS using arguments, files, or JSON on stdin\")\n  }\n  if (html !== undefined && typeof html !== \"string\") {\n    throw new Error(\"html must be a string\")\n  }\n  if (css !== undefined && typeof css !== \"string\") {\n    throw new Error(\"css must be a string\")\n  }\n\n  return { html: html ?? \"\", css: css ?? \"\" }\n}\n\nasync function isExecutable(filePath) {\n  try {\n    await access(filePath, process.platform === \"win32\" ? fsConstants.F_OK : fsConstants.X_OK)\n    return true\n  } catch {\n    return false\n  }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L146-L182","documentation":"If after all resolution html and css are both still undefined, there is nothing to share and the script refuses to proceed. This happens when no flags, no files, no positionals, and no usable stdin content were provided.","triggerScenarios":"Running the script in an interactive terminal with no arguments and no piped stdin; piping only whitespace to stdin; providing only one source via a path the script does not read.","commonSituations":"User runs the binary expecting a prompt; a wrapper that forgets to forward input; stdin is closed/empty in CI.","solutions":["Provide HTML or CSS via --html/--css, --html-file/--css-file, positional args, or JSON on stdin.","If scripting non-interactively, pipe the JSON payload explicitly.","Run with --help to see the accepted input forms."],"exampleFix":"# before\nbun .../index.mjs\n# after\necho '{\"html\":\"<div>hi</div>\",\"css\":\"@import \\\"tailwindcss\\\";\"}' | bun .../index.mjs","handlingStrategy":"validation","validationCode":"if (html === undefined && css === undefined) {\n  throw new Error('Provide HTML/CSS using arguments, files, or JSON on stdin')\n}","typeGuard":"const hasInput = (o) => o.html !== undefined || o.css !== undefined || o.htmlFile !== undefined || o.cssFile !== undefined","tryCatchPattern":null,"preventionTips":["Always pass at least one HTML or CSS source.","In non-interactive shells, pipe the JSON payload explicitly.","Run with --help to review the accepted input forms."],"tags":["cli","stdin","argument","validation"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}