{"record":{"id":"1cfd19b7596e9eca","repo":"withastro/astro","slug":"no-contents-found-for-entry","errorCode":null,"errorMessage":"No contents found for ${entry}","messagePattern":"No contents found for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro/src/content/loaders/glob.ts","lineNumber":142,"sourceCode":"\t\t\tconst untouchedEntries = new Set(store.keys());\n\t\t\tasync function syncData(\n\t\t\t\tentry: string,\n\t\t\t\tbase: URL,\n\t\t\t\tentryType?: ContentEntryType,\n\t\t\t\toldId?: string,\n\t\t\t) {\n\t\t\t\tif (!entryType) {\n\t\t\t\t\tlogger.warn(`No entry type found for ${entry}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst fileUrl = new URL('./' + encodeURI(entry), base);\n\t\t\t\tconst contents = await fs.readFile(fileUrl, 'utf-8').catch((err) => {\n\t\t\t\t\tlogger.error(`Error reading ${entry}: ${err.message}`);\n\t\t\t\t\treturn;\n\t\t\t\t});\n\n\t\t\t\tif (!contents && contents !== '') {\n\t\t\t\t\tlogger.warn(`No contents found for ${entry}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { body, data } = await entryType.getEntryInfo({\n\t\t\t\t\tcontents,\n\t\t\t\t\tfileUrl,\n\t\t\t\t});\n\n\t\t\t\tconst id = generateId({ entry, base, data });\n\n\t\t\t\tif (oldId && oldId !== id) {\n\t\t\t\t\tstore.delete(oldId);\n\t\t\t\t}\n\n\t\t\t\tuntouchedEntries.delete(id);\n\n\t\t\t\tconst existingEntry = store.get(id);\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/withastro/astro/blob/e294953aa8aadd98d5be92e60a03037b05dbdfd4/packages/astro/src/content/loaders/glob.ts#L124-L160","documentation":"fs.readFile failed for a file the glob loader matched; the underlying OS error was already logged as 'Error reading <entry>'. Because the .catch returns undefined, this second warning fires when contents is undefined (the file could not be read at all), as opposed to a legitimately empty file, which passes the contents !== '' check.","triggerScenarios":"A file matched by the glob is deleted, renamed, or becomes unreadable between the glob and the read (dev-server watch races); permission errors; broken symlinks; files removed by git operations mid-sync.","commonSituations":"Editors doing atomic saves (write temp file + rename) while `astro dev` is running; content on network/synced mounts with flaky reads; restrictive file permissions in CI runners.","solutions":["Check the preceding 'Error reading <entry>' error line for the real OS message and fix that cause (permissions, missing file)","Restart the dev server if it was a transient race during a file rename or delete","Exclude the problematic path from the glob pattern if it is not content"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before a sync, confirm the matched files still exist and are readable\nimport { access, constants } from 'node:fs/promises';\nasync function assertReadable(files: string[]) {\n  await Promise.all(files.map((f) => access(f, constants.R_OK)));\n}","typeGuard":null,"tryCatchPattern":"// Handle editor atomic-save races with bounded backoff around reads\nimport { readFile } from 'node:fs/promises';\nasync function readWithRetry(path: string, attempts = 3): Promise<string> {\n  for (let i = 0; i < attempts; i++) {\n    try { return await readFile(path, 'utf-8'); }\n    catch (err) {\n      if (i === attempts - 1) throw err;\n      await new Promise((r) => setTimeout(r, 100 * 2 ** i));\n    }\n  }\n  throw new Error('unreachable');\n}","preventionTips":["Expect transient read failures during dev watch; the warning is usually self-healing on the next event","Keep content directories out of sync-client folders and flaky network mounts","Avoid deleting/renaming many content files while a build is running"],"tags":["astro","content-collections","glob-loader","filesystem","watch-mode"],"backgroundTag":"file-read-failure","analyzedSha":"e294953aa8aadd98d5be92e60a03037b05dbdfd4","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}