{"record":{"id":"a1cfe03c5ac611ac","repo":"moeru-ai/airi","slug":"cannot-find-file-path","errorCode":null,"errorMessage":"Cannot find file: ${path}","messagePattern":"Cannot find file: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/stage-ui-live2d/src/utils/live2d-zip-loader.ts","lineNumber":210,"sourceCode":"            '': motions.map(motion => ({ File: motion })),\n          }\n        : undefined,\n    },\n  })\n\n  settings.name = modelName\n\n  // provide this property for FileLoader\n  Object.assign(settings, { _objectURL: `example://${settings.url}` })\n\n  return settings\n}\n\nZipLoader.readText = async (jsZip: JSZip, path: string) => {\n  const file = jsZip.file(path)\n\n  if (!file) {\n    throw new Error(`Cannot find file: ${path}`)\n  }\n\n  const text = await file.async('text')\n\n  return isSettingsFile(path) ? sanitizeModelSettingsText(text) : text\n}\n\nconst defaultFileLoaderReadText = FileLoader.readText\nFileLoader.createSettings = async (files: File[]) => {\n  const settingsFile = files.find(file => isSettingsFile(file.webkitRelativePath || file.name))\n\n  if (!settingsFile) {\n    throw new TypeError('Settings file not found')\n  }\n\n  const settingsUrl = settingsFile.webkitRelativePath || settingsFile.name\n  const settingsText = await FileLoader.readText(settingsFile)\n  const settings = createModelSettings(settingsText, settingsUrl)","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/packages/stage-ui-live2d/src/utils/live2d-zip-loader.ts#L192-L228","documentation":"`ZipLoader.readText(jsZip, path)` looks up a file by `path` inside the JSZip instance via `jsZip.file(path)`. If no entry matches (returns a falsy value), it throws `Cannot find file: <path>`. This patched reader is invoked by the Live2D runtime when it tries to load a referenced asset (moc, texture, motion, physics) from the archive.","triggerScenarios":"The model manifest references a file (e.g. `FileReferences.Moc` or a texture path) that does not exist in the ZIP, or the path casing/separator differs from the actual archive entry (`\\` vs `/`, leading `./`, nested folder mismatch).","commonSituations":"Manifest edited by hand with a wrong path; model packaged on Windows with backslashes; case-sensitivity mismatch between a macOS-authored manifest and a Linux extractor; a referenced motion/physics file omitted from the archive.","solutions":["Cross-check every path in `FileReferences` against the actual ZIP entries (case- and separator-sensitive).","Normalize separators to `/` and remove leading `./` in manifest references.","Ensure all referenced assets (moc, textures, motions, physics, pose, display names) are included in the archive.","If a reference is optional, mark it correctly so the runtime does not request it."],"exampleFix":"// before\n// manifest Moc: \"Model/Moc/model.moc3\" but archive has \"model.moc3\" at root\n\n// after\n// align manifest paths with archive layout, or move the file to match\nMoc: \"model.moc3\"\nTextures: [\"texture_00.png\"]","handlingStrategy":"validation","validationCode":"const exists = !!zip.file(path)\nif (!exists) throw new Error(`Cannot find file: ${path}`)\nawait ZipLoader.readText(zip, path)","typeGuard":"function zipHasPath(zip: JSZip, path: string): boolean {\n  return !!zip.file(path)\n}","tryCatchPattern":"try {\n  await loadLive2DFromArchive(blob)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Cannot find file:')) {\n    // inspect manifest references vs archive entries\n  } else throw e\n}","preventionTips":["Align manifest paths with archive layout (case- and separator-sensitive).","Normalize backslashes to '/' and strip leading './'.","Bundle every referenced asset (moc, textures, motions, physics, pose)."],"tags":["live2d","model-loading","archive","path-resolution"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}