{"record":{"id":"3ab32014ddc7aed7","repo":"kataras/iris","slug":"s-w-3ab320","errorCode":null,"errorMessage":"%s: %w","messagePattern":"%s: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"view/jet.go","lineNumber":255,"sourceCode":"\n\t\tif info == nil || info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\n\t\tif s.extension != \"\" {\n\t\t\tif !strings.HasSuffix(path, s.extension) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tif s.rootDir == rootDirName {\n\t\t\tpath = strings.TrimPrefix(path, rootDirName)\n\t\t\tpath = strings.TrimPrefix(path, \"/\")\n\t\t}\n\n\t\tbuf, err := asset(s.fs, path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"%s: %w\", path, err)\n\t\t}\n\n\t\treturn s.ParseTemplate(path, string(buf))\n\t})\n}\n\n// ParseTemplate accepts a name and contnets to parse and cache a template.\n// This parser does not support funcs per template. Use the `AddFunc` instead.\nfunc (s *JetEngine) ParseTemplate(name string, contents string) error {\n\ts.initSet()\n\n\t_, err := s.Set.Parse(name, contents)\n\treturn err\n}\n\nfunc (s *JetEngine) initSet() {\n\ts.mu.Lock()\n\tif s.Set == nil {","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/kataras/iris/blob/7bedaf55a0b64bbb2248a5845a2c60d81a30996a/view/jet.go#L237-L273","documentation":"The Jet engine's Load walks its asset filesystem and reads each template with the asset helper; on read failure it wraps the underlying error with the template path (fmt.Errorf(\"%s: %w\", path, err)) before attempting ParseTemplate. It mirrors error 131 but for the Jet template engine.","triggerScenarios":"JetEngine.Load iterating registered paths where reading path from s.fs fails — missing embedded directory, wrong rootDirName trimming, or an OS-fs file deleted/renamed after registration.","commonSituations":"Jet templates stored under a folder not included in go:embed; loader root folder name differs from the embedded top-level directory so trimmed paths point to nonexistent entries; renaming .jet files without re-embedding.","solutions":["Read the wrapped inner error to identify the missing/unreadable file and restore or fix its path.","Ensure the embedded FS covers the Jet template root (//go:embed views and matching directory name).","Make the loader's rootDirName match the actual top-level folder in the fs so trimmed paths resolve.","Trigger Load() during boot to fail fast instead of at first render."],"exampleFix":"// before\n//go:embed templates/*.html\nvar fs embed.FS\nengine := jet.New(fs, \".jet\")\n// after\n//go:embed templates\nvar fs embed.FS\nengine := jet.New(fs, \".jet\")","handlingStrategy":"validation","validationCode":"if _, err := fs.ReadFile(jetFS, \"views/index.jet\"); err != {\n    log.Fatalf(\"jet templates not embedded/readable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := jetEngine.Load(); err != nil {\n    log.Fatalf(\"jet engine load failed (path in message): %v\", err)\n}","preventionTips":["Embed the whole jet template root directory, not individual files.","Keep rootDirName passed to the loader identical to the embedded top-level folder.","Call Load() at startup so read failures surface before traffic arrives.","After renaming/moving .jet files, re-run go build to refresh the embedded FS."],"tags":["jet","template-loading","filesystem","embedded-fs"],"backgroundTag":"asset-read-failed","analyzedSha":"7bedaf55a0b64bbb2248a5845a2c60d81a30996a","analyzedAt":"2026-08-30T20:38:16.250Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}