{"record":{"id":"79e381d7c95b1ff1","repo":"flarum/framework","slug":"error","errorCode":null,"errorMessage":"error","messagePattern":"error","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"framework/core/js/src/common/ExportRegistry.ts","lineNumber":131,"sourceCode":"      this.onLoads.set(namespace, this.onLoads.get(namespace) || new Map());\n      this.onLoads.get(namespace)?.set(id, this.onLoads.get(namespace)?.get(id) || []);\n      this.onLoads.get(namespace)?.get(id)?.push(handler);\n    }\n  }\n\n  get(namespace: string, id: string): any {\n    const module = this.moduleExports.get(namespace)?.get(id);\n    const extensionEnabled = namespace in flarum.extensions || namespace === 'core';\n    const error = `No module found for ${namespace}:${id}`;\n\n    // Check if the module is registered in a chunk (will be loaded lazily)\n    const isInChunk = this.chunkModules.has(`${namespace}:${id}`);\n\n    // @ts-ignore\n    if (!module && extensionEnabled && !isInChunk && flarum.debug) {\n      throw new Error(error);\n    } else if (!module && extensionEnabled && !isInChunk) {\n      console.warn(error);\n    }\n\n    return module;\n  }\n\n  public checkModule(namespace: string, id: string): any | false {\n    const exists = (this.moduleExports.has(namespace) && this.moduleExports.get(namespace)?.has(id)) || false;\n\n    return exists ? this.get(namespace, id) : false;\n  }\n\n  addChunkModule(chunkId: number | string, moduleId: number | string, namespace: string, urlPath: string): void {\n    if (!this.chunks.has(chunkId.toString())) {\n      this.chunks.set(chunkId.toString(), {\n        namespace,\n        urlPath,\n        modules: [urlPath],\n      });","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/js/src/common/ExportRegistry.ts#L113-L149","documentation":"ExportRegistry.get() throws this Error when a requested module (namespace:id) cannot be found in the registry or loaded chunks while the extension is enabled and the site is running in debug mode (flarum.debug). In debug mode the registry treats a missing module as a hard error so extension authors notice broken imports immediately; in production it only logs a console.warn. The generic 'error' string is the pre-built error message variable assembled by the caller.","triggerScenarios":"Calling app.reg.getModule / registry.get(namespace, id) for an id that is neither registered nor present in any loaded chunk (this.chunkModules has no `${namespace}:${id}`) while extensionEnabled is true and flarum.debug is true.","commonSituations":"An extension registers/imports a module id that was renamed or removed in a newer flarum/core; a frontend chunk failed to load so its modules were never exported; a typo in the namespace or id; an extension extends another extension's module that is lazily chunked and not yet loaded.","solutions":["Check the exact namespace:id string against the source extension's registered exports for the flarum version you run.","Ensure the chunk containing the module is actually loaded (verify the extension's js dist is built and the chunk import is triggered before get()).","Update or downgrade the extension so its expected module ids match your flarum/core version.","If the warning is acceptable in production only, disable debug mode — but fix the root cause in development.","Rebuild the extension's JS assets (npm run build) if dist files are stale."],"exampleFix":"// before\nconst Post = app.reg.getModule('flarum/forum', 'components/PostStream'); // renamed id\n// after\nconst Post = app.reg.getModule('flarum/forum', 'components/PostStream'); // verify id via app.reg / module docs for your core version","handlingStrategy":"validation","validationCode":"const id = 'components/PostStream';\nconst ns = 'flarum/forum';\nif (!app.reg.moduleExists?.(ns, id) && !app.reg.getChunk?.(ns)) {\n  console.warn(`Skipping missing module ${ns}:${id}`);\n} else {\n  const mod = app.reg.getModule(ns, id);\n}","typeGuard":"function hasModule(reg, namespace, id) {\n  return typeof reg?.getModule === 'function' && reg.getModule(namespace, id) != null;\n}","tryCatchPattern":"try {\n  const mod = app.reg.getModule(ns, id);\n} catch (e) {\n  console.error(`Module ${ns}:${id} not found; feature disabled`, e);\n  return null;\n}","preventionTips":["Pin extension versions compatible with your flarum/core release.","Check registry/module ids against upstream source before extending them.","Keep frontend dist assets built and deployed with each release.","Enable debug mode in dev environments to catch missing modules early.","Guard third-party module lookups before consuming the result."],"tags":["debug-mode","module-resolution","frontend","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"}