{"record":{"id":"26ff0a016924a390","repo":"garrytan/gstack","slug":"element-not-found-sel","errorCode":null,"errorMessage":"Element not found: ${sel}","messagePattern":"Element not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/cdp-inspector.ts","lineNumber":576,"sourceCode":"            range,\n            text: newPropsText,\n          }],\n        });\n        method = 'setStyleTexts';\n        source = `${targetRule.source}:${targetRule.sourceLine}`;\n        sourceLine = targetRule.sourceLine;\n      } catch (err: any) {\n        // Fall back to inline — setStyleTexts fails on immutable stylesheets or stale ranges\n        if (!err?.message?.includes('style') && !err?.message?.includes('range') && !err?.message?.includes('closed') && !err?.message?.includes('Target')) throw err;\n      }\n    }\n\n    if (method === 'inline') {\n      // Fallback: modify via inline style\n      await page.evaluate(\n        ([sel, prop, val]) => {\n          const el = document.querySelector(sel);\n          if (!el) throw new Error(`Element not found: ${sel}`);\n          (el as HTMLElement).style.setProperty(prop, val);\n        },\n        [selector, property, value]\n      );\n    }\n  } catch (err: any) {\n    // Full fallback: use page.evaluate for headless\n    await page.evaluate(\n      ([sel, prop, val]) => {\n        const el = document.querySelector(sel);\n        if (!el) throw new Error(`Element not found: ${sel}`);\n        (el as HTMLElement).style.setProperty(prop, val);\n      },\n      [selector, property, value]\n    );\n  }\n\n  const modification: StyleModification = {","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/cdp-inspector.ts#L558-L594","documentation":"Error \"Element not found: ${sel}\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/cdp-inspector.ts:576 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"}