Angular class is not an Angular module

前端 未结 2 1037
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 07:28

When I build my Angular library, publish it to npm, and use it as a dependency in another project, whenever I try to import on of my module classes into my app.module.

2条回答
  •  逝去的感伤
    2021-01-18 07:56

    So I had the same issue with a different solution, so I thought I would share it here.

    I had just updated my library to Angular 9. And everything seemed fine except the strange "Class my-module is not an Angular module" error.

    What worked for me was to up tsconfig.lib.ts file with:

    ...
    "angularCompilerOptions": {
      ...,
      "enableIvy": false
    }

提交回复
热议问题