{"record":{"id":"679c7937e2f9b353","repo":"flarum/framework","slug":"export-registry-no-chunk-by-the-id-chunkid-found","errorCode":null,"errorMessage":"[Export Registry] No chunk by the ID ${chunkId} found.","messagePattern":"\\[Export Registry\\] No chunk by the ID (.+?) found\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"framework/core/js/src/common/ExportRegistry.ts","lineNumber":164,"sourceCode":"        namespace,\n        urlPath,\n        modules: [urlPath],\n      });\n    } else {\n      this.chunks.get(chunkId.toString())?.modules?.push(urlPath);\n    }\n\n    this.chunkModules.set(`${namespace}:${urlPath}`, {\n      chunkId: chunkId.toString(),\n      moduleId: moduleId.toString(),\n    });\n  }\n\n  getChunk(chunkId: number | string): Chunk | null {\n    const chunk = this.chunks.get(chunkId.toString()) ?? null;\n\n    if (!chunk) {\n      console.warn(`[Export Registry] No chunk by the ID ${chunkId} found.`);\n      return null;\n    }\n\n    return chunk;\n  }\n\n  async loadChunk(original: Function, url: string, done: (...args: any) => Promise<void>, key: number, chunkId: number | string): Promise<void> {\n    // @ts-ignore\n    app.alerts.showLoading();\n\n    const chunkUrl = this.chunkUrl(chunkId) || url;\n\n    const load = (): Promise<void> =>\n      original(\n        chunkUrl,\n        (...args: any) => {\n          const event: Event | undefined = args[0];\n","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/js/src/common/ExportRegistry.ts#L146-L182","documentation":"ExportRegistry.getChunk() warns (console.warn, not a throw) when a requested chunk id does not exist in this.chunks, and returns null so callers like chunk() can react. Flarum's export registry splits frontend exports into lazily loadable chunks; this warning signals you asked for a chunk that was never registered or already-consumed.","triggerScenarios":"Calling registry.getChunk(id) / registry.chunk(id) with a chunkId (number or string) that is not a key of the chunks Map — usually because the chunk's JS bundle never registered its exports (failed/missed bundle load) or the id is mistyped.","commonSituations":"Extension JS dist assets missing or not deployed after an update; stale cached frontend referencing old chunk ids; manually calling chunk() with a numeric id when only string ids are registered; a build that renamed chunk hashes.","solutions":["Verify the chunk id exists by checking what the extension/core registers (build output or registry keys).","Rebuild/redeploy the extension's frontend dist so chunks are registered.","Clear frontend asset cache / hard reload to drop stale chunk references.","Ensure you await/trigger the chunk load before consuming its exports.","Match id type usage: getChunk stringifies ids internally, so confirm the same string used at registration."],"exampleFix":"// before\nconst chunk = app.reg.getChunk(7); // numeric guess\n// after\nconst chunk = app.reg.getChunk('flarum/core/forum'); // registered chunk id","handlingStrategy":"fallback","validationCode":"const chunkId = 'flarum/core/forum';\nif (typeof app.reg.getChunk === 'function' && app.reg.getChunk(chunkId) === null) {\n  console.warn(`Chunk ${chunkId} unavailable; skipping dependent feature`);\n}","typeGuard":"function hasChunk(reg, id) {\n  return reg?.getChunk?.(id.toString()) != null;\n}","tryCatchPattern":"const chunk = app.reg.getChunk(chunkId);\nif (chunk === null) {\n  console.warn(`Chunk ${chunkId} missing; falling back to lazy import`);\n  return import('flarum/core/forum').catch(() => null);\n}","preventionTips":["Verify chunk ids against the build manifest, never guess them.","Redeploy/rebuild frontend assets after core or extension upgrades.","Bust stale caches so old chunk references disappear.","Check chunk availability (null return) before consuming exports.","Register fallback lazy imports for optional chunks."],"tags":["chunk-loading","frontend","module-resolution","flarum"],"backgroundTag":"resource-not-found","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}