{"record":{"id":"ccd32dd7fa644dd8","repo":"garrytan/gstack","slug":"load-html-file-not-found-at-absolutepath-chec","errorCode":null,"errorMessage":"load-html: file not found at ${absolutePath}. Check spelling or copy the file under ${process.cwd()} or ${TEMP_DIR}.","messagePattern":"load-html: file not found at (.+?)\\. Check spelling or copy the file under (.+?) or (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"browse/src/write-commands.ts","lineNumber":277,"sourceCode":"\n      const absolutePath = path.resolve(filePath);\n\n      // Safe-dirs check (reuses canonical read-side policy)\n      try {\n        validateReadPath(absolutePath);\n      } catch (e: any) {\n        throw new Error(\n          `load-html: ${absolutePath} must be under ${SAFE_DIRECTORIES.join(' or ')} (security policy). Copy the file into the project tree or /tmp first.`\n        );\n      }\n\n      // stat check — reject non-file targets with actionable error\n      let stat: fs.Stats;\n      try {\n        stat = await fs.promises.stat(absolutePath);\n      } catch (e: any) {\n        if (e.code === 'ENOENT') {\n          throw new Error(\n            `load-html: file not found at ${absolutePath}. Check spelling or copy the file under ${process.cwd()} or ${TEMP_DIR}.`\n          );\n        }\n        throw e;\n      }\n      if (stat.isDirectory()) {\n        throw new Error(`load-html: ${absolutePath} is a directory, not a file. Pass a .html file.`);\n      }\n      if (!stat.isFile()) {\n        throw new Error(`load-html: ${absolutePath} is not a regular file.`);\n      }\n\n      // Size cap\n      const MAX_BYTES = parseInt(process.env.GSTACK_BROWSE_MAX_HTML_BYTES || '', 10) || (50 * 1024 * 1024);\n      if (stat.size > MAX_BYTES) {\n        throw new Error(\n          `load-html: file too large (${stat.size} bytes > ${MAX_BYTES} cap). Raise with GSTACK_BROWSE_MAX_HTML_BYTES=<N> or split the HTML.`\n        );","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/write-commands.ts#L259-L295","documentation":"Error \"load-html: file not found at ${absolutePath}. Check spelling or copy the file under ${process.cwd()} or ${TEMP_DIR}.\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/write-commands.ts:277 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"}