Skip to content

Exported array of standalone components cannot be imported #48089

@GuillaumeNury

Description

@GuillaumeNury

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

I have a library that export multiple component in a const as advised in the standalone guide:

const LU_SIMPLE_SELECT_COMPONENTS = [
  LuSimpleSelectInputComponent,
  LuOptionDirective,
  LuDisplayerDirective,
  LuOptionComponent,
] as const;

Whenever I import this constant from a module or in a component in an application that use my library, I have the following issue:

Value at position 0 in the NgModule.imports of AppModule is not a reference
Value could not be determined statically.

If I redefined the same const in the application, it works.

Links

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-ivy-5rgxzc?file=src%2Fapp%2Fapp.module.ts

Please provide the exception or error you saw

> Value at position 0 in the NgModule.imports of AppModule is not a reference
> Value could not be determined statically.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 14.1.3        
Node: 16.14.2
Package Manager: npm 8.5.0
OS: win32 x64

Angular: 14.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1401.3
@angular-devkit/build-angular   14.1.3
@angular-devkit/core            14.1.3
@angular-devkit/schematics      14.1.3
@angular/cdk                    14.2.7
@schematics/angular             14.1.3
rxjs                            7.5.7
typescript                      4.7.4

Anything else?

Love Standalone components!

Metadata

Metadata

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerbugcross-cutting: standaloneIssues related to the NgModule-less worldstate: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions