{"record":{"id":"b1e8633f3935a306","repo":"saadeghi/daisyui","slug":"css-must-be-a-string","errorCode":null,"errorMessage":"css must be a string","messagePattern":"css must be a string","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":170,"sourceCode":"      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  }\n}\n\nasync function resolveExecutable(candidate) {\n  if (!candidate) return undefined\n\n  if (isAbsolute(candidate) || candidate.includes(\"/\") || candidate.includes(\"\\\\\")) {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L152-L188","documentation":"Mirror of the html type check: if css is defined but not a string (number, array, object, or null), the script throws. null for css is treated as a bad type, not as absent.","triggerScenarios":"Piping JSON like `{\"css\":42}`, `{\"css\":{\"import\":true}}`, or `{\"css\":null}`.","commonSituations":"Producer serializes an object/number for css; null intended to mean 'no css'.","solutions":["Ensure the css field is a JSON string.","Omit the css key if you have no CSS.","Coerce css to a string before emitting JSON."],"exampleFix":"# before\necho '{\"html\":\"<div/>\",\"css\":null}' | bun .../index.mjs\n# after\necho '{\"html\":\"<div/>\",\"css\":\"\"}' | bun .../index.mjs","handlingStrategy":"type-guard","validationCode":"if (css !== undefined && typeof css !== 'string') {\n  throw new Error('css must be a string')\n}","typeGuard":"const isOptionalString = (v) => v === undefined || typeof v === 'string'","tryCatchPattern":null,"preventionTips":["Serialise css as a JSON string in your producer.","Omit the css key rather than passing null when you have none.","Validate the JSON shape with a schema before piping."],"tags":["cli","stdin","json","validation","type"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}