Angular 9: Value at position X in the NgModule.imports is not a reference

前端 未结 4 2024
轻奢々
轻奢々 2021-01-18 03:40

I upgraded an Angular App from v8 to v9. The project imports a custom UI library using Angular 8 and moment.js.

When I build it:

  1. It genera
4条回答
  •  孤城傲影
    2021-01-18 04:19

    you need to change your custom build of modules, so you need to make analog changes to the ones below, in my case i needed to change:

    export class ThemeModule {
      static forRoot(): ModuleWithProviders {
        return {
          ngModule: ThemeModule,
          providers: [
            ...NbThemeModule.forRoot(
              {
                name: 'default',
              },
              [DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME],
            ).providers,
          ],
        };
      }
    }
    

    to:

    export class ThemeModule {
      static forRoot(): ModuleWithProviders {
        return {
          ngModule: ThemeModule,
          providers: [
            ...NbThemeModule.forRoot(
              {
                name: 'default',
              },
              [DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME],
            ).providers,
          ],
        };
      }
    }
    

提交回复
热议问题