{"record":{"id":"1cedda8917c6537c","repo":"angular/angular","slug":"unsupported-type-its-name-could-not-be-determined-1cedda","errorCode":null,"errorMessage":"Unsupported type, its name could not be determined","messagePattern":"Unsupported type, its name could not be determined","errorType":"exception","errorClass":"FatalLinkerError","httpStatus":null,"severity":"error","filePath":"packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.ts","lineNumber":45,"sourceCode":"  linkPartialDeclaration(\n    constantPool: ConstantPool,\n    metaObj: AstObject<R3PartialDeclaration, TExpression>,\n  ): LinkedDefinition {\n    const meta = toR3InjectorMeta(metaObj);\n    return compileInjector(meta);\n  }\n}\n\n/**\n * Derives the `R3InjectorMetadata` structure from the AST object.\n */\nexport function toR3InjectorMeta<TExpression>(\n  metaObj: AstObject<R3DeclareInjectorMetadata, TExpression>,\n): R3InjectorMetadata {\n  const typeExpr = metaObj.getValue('type');\n  const typeName = typeExpr.getSymbolName();\n  if (typeName === null) {\n    throw new FatalLinkerError(\n      typeExpr.expression,\n      'Unsupported type, its name could not be determined',\n    );\n  }\n\n  return {\n    name: typeName,\n    type: wrapReference(typeExpr.getOpaque()),\n    providers: metaObj.has('providers') ? metaObj.getOpaque('providers') : null,\n    imports: metaObj.has('imports') ? metaObj.getArray('imports').map((i) => i.getOpaque()) : [],\n  };\n}\n","sourceCodeStart":27,"sourceCodeEnd":58,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.ts#L27-L58","documentation":"Thrown by the Angular partial-declaration linker when converting a ɵɵngDeclareInjector declaration (the injector of an NgModule) into R3InjectorMetadata. The `type` field must be a direct reference to the NgModule class so its name can be extracted; a value with no resolvable symbol name causes FatalLinkerError and fails the application build.","triggerScenarios":"An injector declaration whose `type` is not a plain class reference — object literal, call expression, conditional, or minifier-mangled identifier. Compiler-generated declarations always use `type: MyModule`.","commonSituations":"Hand-written ɵɵngDeclareInjector metadata; libraries post-processed by bundlers before publishing; linking against a library compiled with an incompatible Angular version.","solutions":["Rebuild and republish the library with a compatible Angular compiler","Point `type` at the NgModule class directly in hand-written declarations","Upgrade the application's Angular toolchain","Avoid transforming/minifying published library output"],"exampleFix":"// before\nɵɵngDeclareInjector({ ..., type: modules['AppModule'] });\n// after\nɵɵngDeclareInjector({ ..., type: AppModule });","handlingStrategy":"validation","validationCode":"// Generator sanity check for injector declarations\nif (!('name' in (injectorMeta.type ?? {})) && typeof injectorMeta.type !== 'string') {\n  throw new Error('ɵɵngDeclareInjector `type` must reference the NgModule class directly');\n}","typeGuard":"function isClassIdentifier(node: unknown): node is {type: 'Identifier'; name: string} {\n  return !!node && typeof node === 'object' && (node as any).type === 'Identifier';\n}","tryCatchPattern":"try {\n  fileLinker.linkPartialDeclaration(fnName, args, scope);\n} catch (e) {\n  if (e instanceof FatalLinkerError && /its name could not be determined/.test(e.message)) {\n    // injector `type` was not a named reference — fix the generator/library\n  }\n  throw e;\n}","preventionTips":["Always reference the NgModule class directly in injector metadata","Keep module index re-exports from wrapping the type expression","Regenerate library artifacts with matching toolchain versions"],"tags":["angular-linker","ngmodule","injector","partial-compilation","build-error"],"backgroundTag":"unresolvable-symbol-reference","analyzedSha":"51cb07e98081ab7e4e84a9e0949266a8e19cca84","analyzedAt":"2026-08-22T07:04:54.531Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}