{"record":{"id":"eb6db2f51abe5856","repo":"slidevjs/slidev","slug":"invalid-timestamp-value-match-1","errorCode":null,"errorMessage":"Invalid timestamp value: ${match[1]}","messagePattern":"Invalid timestamp value: (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/parser/src/timesplit/timestring.ts","lineNumber":90,"sourceCode":"      hrs: 3600,\n      hour: 3600,\n      hours: 3600,\n      day: 86400,\n      days: 86400,\n      week: 604800,\n      weeks: 604800,\n      month: 2629746,\n      months: 2629746,\n      year: 31556952,\n      years: 31556952,\n    }\n    const regex = /([\\d.]+)([a-z]+)/gi\n    const matches = timestamp.matchAll(regex)\n    if (matches) {\n      for (const match of matches) {\n        const value = Number(match[1])\n        if (Number.isNaN(value)) {\n          throw new TypeError(`Invalid timestamp value: ${match[1]}`)\n        }\n        const unit = match[2].toLowerCase()\n        if (!(unit in unitMap)) {\n          throw new TypeError(`Invalid timestamp unit: ${unit}`)\n        }\n        seconds += value * unitMap[unit]\n      }\n    }\n    const remaining = timestamp.replace(regex, '').trim()\n    if (remaining) {\n      throw new TypeError(`Unknown timestamp remaining: ${remaining}`)\n    }\n  }\n\n  return {\n    seconds,\n    relative,\n  }","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/parser/src/timesplit/timestring.ts#L72-L108","documentation":"Inside the unit-based parser, the regex ([\\d.]+)([a-z]+) captured a value segment that Number() returned NaN for. In practice this is hard to hit because the regex requires digits/dots, but values like '.' (dot only) or unusual unicode digits can trigger it.","triggerScenarios":"A unit-string segment whose numeric prefix is non-parseable, e.g. '.s' (no digits) or '..5s'.","commonSituations":"Hand-typed timestamps missing the leading digit, double dots, or unicode digit lookalikes.","solutions":["Always supply at least one digit before the unit (5s not .s)","Avoid stray dots in the numeric portion","Use plain seconds (e.g. 5) for simple values"],"exampleFix":"// before\ntimesplit: .s\n// after\ntimesplit: 1s","handlingStrategy":"validation","validationCode":"function validUnitValues(ts: string): boolean {\n  return Array.from(ts.matchAll(/([\\d.]+)([a-z]+)/gi)).every(m => Number.isFinite(Number(m[1])))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always prefix units with at least one digit","Avoid stray dots in the numeric part of a unit value"],"tags":["timestamp","parser","validation"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}