{"record":{"id":"1c6d210e3a152271","repo":"egametang/ET","slug":"no-nav-data-name","errorCode":null,"errorMessage":"no nav data: {name}","messagePattern":"no nav data: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"Packages/cn.etetet.recast/Scripts/Model/Share/NavmeshComponent.cs","lineNumber":37,"sourceCode":"        \n        public void Awake()\n        {\n        }\n\n        public async ETTask Load(string name)\n        {\n            if (this.navmeshs.ContainsKey(name))\n            {\n                return;\n            }\n            \n            byte[] buffer =\n                    await EventSystem.Instance.Invoke<RecastFileLoader, ETTask<byte[]>>(\n                        new RecastFileLoader() { Name = name });\n            \n            if (buffer.Length == 0)\n            {\n                throw new Exception($\"no nav data: {name}\");\n            }\n            \n            DtMeshSetReader reader = new();\n            using MemoryStream ms = new(buffer);\n            using BinaryReader br = new(ms);\n            DtNavMesh navMesh = reader.Read(br, 6); // cpp recast导出来的要用Read32Bit读取，DotRecast导出来的还没试过\n            this.navmeshs.TryAdd(name, navMesh);\n        }\n        \n        public DtNavMesh Get(string name)\n        {\n            return this.navmeshs[name];\n        }\n    }\n}\n","sourceCodeStart":19,"sourceCodeEnd":53,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.recast/Scripts/Model/Share/NavmeshComponent.cs#L19-L53","documentation":"NavmeshComponent.Load awaits an EventSystem.Invoke<RecastFileLoader, ETTask<byte[]>> to fetch the navmesh bytes, then throws 'no nav data' if the returned buffer is empty. This is the load-time guard that fires before any DtMeshSetReader parsing.","triggerScenarios":"Load(name) is called and the RecastFileLoader event handler returns a zero-length byte array. The file lookup resolved but produced no content (or returned an explicit empty buffer).","commonSituations":"The recast (.nav) file is missing from the bundle/streaming assets so the loader returns empty; the file name has a typo or wrong path; the resource system isn't configured for the map; the file exists but is zero bytes on disk; wrong CodeMode/resource provider so the handler can't find it.","solutions":["Verify the recast nav file for the map exists at the expected resource path and is non-empty.","Check the RecastFileLoader handler registration — confirm it maps the name to the right bundle/path.","Confirm the resource/bundle system has actually loaded the map's bundle before Load is called.","Bake/export the navmesh with the recast tooling if the file is missing."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-check file existence/content before calling Load\nbyte[] bytes = await EventSystem.Instance.Invoke<RecastFileLoader, ETTask<byte[]>>(new RecastFileLoader { Name = name });\nif (bytes == null || bytes.Length == 0)\n    throw new FileNotFoundException($\"Recast nav file '{name}' is missing or empty\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bake nav files for every map and include them in the asset bundle.","Verify the RecastFileLoader handler is registered and resolves the name correctly.","Add a startup integrity check that all referenced maps have non-empty nav files."],"tags":["recast","navmesh","missing-asset","resource-loading"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}