I am currently working on developing a custom module to store all my UI components. It is essential that this module is compatible with Angular 10 and above. Here is the package.json file for my library:
{
"name": "myLibModule",
"version": "0.0.15",
"peerDependencies": {
"@angular/core": "^10.2.5",
"@angular/common": "^10.2.5",
"@angular/material": "^10.2.7",
"@angular/router": "^10.2.5"
},
"dependencies": {
"tslib": "^2.0.0"
}
}
In addition, here is my custom Module:
import { NgModule } from '@angular/core';
import { HeaderComponent } from './components/header/header.component';
import { NotificationTrayComponent } from './poettinger-notifications/components/notification-tray/notification-tray.component';
import { CommonModule } from '@common/common';
import { NotificationComponent } from './poettinger-notifications/components/notification/notification.component';
import { NgbProgressbarModule } from '@ng-bootstrap/ng-bootstrap';
@NgModule({
declarations: [HeaderComponent, NotificationTrayComponent, NotificationComponent],
imports: [
CommonModule,
NgbProgressbarModule
],
exports: [HeaderComponent, NotificationTrayComponent]
})
export class NgxPoettingerComponentsModule { }
Upon trying to incorporate it into my Angular application, which has the following package.json file:
{
"name": "libtest",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.2.0",
"@angular/cdk": "^12.2.13",
"@angular/common": "~12.2.0",
"@angular/compiler": "~12.2.0",
"@angular/core": "~12.2.0",
"@angular/forms": "~12.2.0",
"@angular/material": "^12.2.13",
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "~12.2.0",
"@angular/router": "~12.2.0",
"@it-entwicklung/ngx-poettinger-components": "file:../lib-workspace/dist/myLibModule",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.13",
"@angular/cli": "~12.2.13",
"@angular/compiler-cli": "~12.2.0",
"@types/jasmine": "~3.8.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.8.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.3.5"
}
}
An error message is thrown as follows:
Uncaught Error: Type NgxPoettingerComponentsModule does not have 'ɵmod' property.
at getNgModuleDef (core.js:1131:1)
at recurse (core.js:25285:1)
at recurse (core.js:25296:1)
at registerNgModuleType (core.js:25281:1)
at new NgModuleFactory$1 (core.js:25395:1)
at compileNgModuleFactory__POST_R3__ (core.js:29094:1)
at PlatformRef.bootstrapModule (core.js:29344:1)
at Module.4431 (main.ts:11:26)
at __webpack_require__ (bootstrap:19:1)
at __webpack_exec__ (log$:23:1)
I have compiled it without using Ivy in production mode. Can someone please guide me on what I might be doing wrong?