{"record":{"id":"1a2ef53a9b7a6503","repo":"garrytan/gstack","slug":"width-must-be-a-number","errorCode":null,"errorMessage":"--width must be a number","messagePattern":"--width must be a number","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/write-commands.ts","lineNumber":1019,"sourceCode":"      let viewportWidth: number | undefined;\n      let outputPath: string | undefined;\n\n      for (let i = 0; i < args.length; i++) {\n        if (args[i] === '--scroll-to' && i + 1 < args.length) {\n          scrollTo = args[++i];\n        } else if (args[i] === '--cleanup') {\n          doCleanup = true;\n        } else if (args[i] === '--hide' && i + 1 < args.length) {\n          // Collect all following non-flag args as selectors to hide\n          i++;\n          while (i < args.length && !args[i].startsWith('--')) {\n            hideSelectors.push(args[i]);\n            i++;\n          }\n          i--; // Back up since the for loop will increment\n        } else if (args[i] === '--width' && i + 1 < args.length) {\n          viewportWidth = parseInt(args[++i], 10);\n          if (isNaN(viewportWidth)) throw new Error('--width must be a number');\n        } else if (!args[i].startsWith('--')) {\n          outputPath = args[i];\n        } else {\n          throw new Error(`Unknown prettyscreenshot flag: ${args[i]}`);\n        }\n      }\n\n      // Default output path\n      if (!outputPath) {\n        const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);\n        outputPath = `${TEMP_DIR}/browse-pretty-${timestamp}.png`;\n      }\n      validateOutputPath(outputPath);\n\n      const originalViewport = page.viewportSize();\n\n      // Set viewport width if specified\n      if (viewportWidth && originalViewport) {","sourceCodeStart":1001,"sourceCodeEnd":1037,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/write-commands.ts#L1001-L1037","documentation":"Error \"--width must be a number\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/write-commands.ts:1019 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}