Encountering an Uncaught Error: MyModule type lacks the 'ɵmod' property

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?

Answer №1

It appears that there may be an issue with the import section of your NgxPoettingerComponentsModule module. It is possible that some components/pipes/services are incorrectly placed in either the declarations or imports section.

If you could provide your module code here, it would be easier to pinpoint the exact problem.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Retrieve information from XML using jQuery

<?xml version="1.0" encoding="UTF-8"?> <slider> <csliderData1> <title>Kung Fu Panda</title> <content>In the Valley of Peace, Po the Panda finds himself chosen as the Dragon Warrior despite</content ...

Ajax request experiencing 500 Internal Server Error. Uncertain about the source of the issue

I'm encountering a 500 Internal Server Error and I'm struggling to pinpoint the root cause of the issue. The purpose of this request is to delete a comment with a specific id from the database. The id is passed through a hidden input field. Below ...

Is there a way to pull information from a string and organize it into a two-dimensional array?

Utilizing the axios library, I am pulling data from a website. Unfortunately, the data being fetched is in HTML format. The extracted data looks like this: 1 Agartala VEAT 120830Z 23004KT 5000 HZ SCT018 SCT025 34/27 Q1004 NOSIG= 2 Ahmedabad VAAH 120830Z 23 ...

Outputting PHP variables in JavaScript is a common practice used to pass

I am struggling to use a variable in my JavaScript code. I have attempted a few methods but none seem to work. The variable I need to include in the JavaScript is option-<?php echo $option['product_option_id']; ?> Below is my current Java ...

No styles are appearing on a specific element after running a specific jQuery function on that element within a Vue page

I recently integrated JQuery-AsRange (https://github.com/thecreation/jquery-asRange) into my vue.js project. Everything functions as expected within the .vue page, however, I am facing an issue with css styling not being applied. The css styles should be ...

Angular - automated pagination functionality without requiring user input

I apologize for the poorly worded title. Context In my static display angular app, I am not incorporating any user interactions and most actions are time-based. The page loads, and after a specific amount of time determined by certain elements, it reload ...

Replace async/await with Promise

I want to convert the async/await code snippet below: const mongoose = require('mongoose') const supertest = require('supertest') const app = require('../app') const api = supertest(app) test("total number of blogs" ...

What could be causing my Angular Ngrx app's state not to render properly on the application?

Is there a way to automatically render the state when the app loads without having to click a button? I am currently facing an issue where the state is empty until I manually trigger the click function by pressing a button. I have tried using this.store.se ...

Displaying an HTML string on a webpage

I am developing a user dashboard using Django for a Python-based web application. This web application generates emails, and the HTML content of these emails is stored in a file (and potentially in a database table as well). As part of the dashboard's ...

Implementing styling upon app mounting in Vue.js - a step-by-step guide

Hey, I'm working with a template code that looks like this: Here's my script code: data () { return { loadPage: true } }, mounted () { this.loadPage = true }, And here is my styling code: #app{ width: 100%; opacit ...

Disabling breakpoints without bounds during TypeScript debugging in Visual Studio Code

While working on my Ubuntu machine using VS Code to debug a Nest.js TypeScript project, I am encountering issues with unbound breakpoints that are not being hit. Despite making various changes in the launch.json and tsconfig.json files, as well as trying o ...

Updating JSON objects in jQuery with string keys

I have an array variable containing JSON data and I need to update specific values within the array using string keys. Here is a snippet of what my array looks like: { "all": [ { "image":{ "URL":"img/img1.jpeg", ...

Print out two forms separately using HTML5

I'm currently tackling a project that condenses all content onto one convenient page, housing two forms. Despite my efforts, I have yet to find a successful solution. My goal is to print the Sales person form first, followed by the Customers section. ...

What is preventing the input box from shrinking further?

I created a search box using CSS grid that is supposed to shrink when the page is resized. However, it doesn't seem to shrink as much as I expected it to. Here is how it appears when fully extended: https://i.stack.imgur.com/tPuCg.png And here is how ...

How can I display the value entered in a text input field when using ajax upload?

Is there a way to display the value of an input type text when using ajax for file upload? I have successfully implemented code to upload files to a directory called attachments_files, but I am facing an issue. How can I retrieve and echo the value from i ...

Error: The EJS compiler encountered a SyntaxError due to an unexpected token || in the show component file located at /var/www/html

I'm currently working on a project inspired by Colt Steele's YelpCamp creation during his Udemy Web Dev Bootcamp. Everything was going smoothly until I tried to refactor some code towards the end of the course using YouTube tutorials. Now, whenev ...

Creating unit tests without relying on a testing framework: A guide

My goal is to unit test a simple function using pure JavaScript: NS.isType = function (type, obj) { if (obj.constructor && obj.constructor.name) { return obj.constructor.name === type; } return toString.call(obj) === '[obj ...

AJAX: Building a Robust Single Page Application with Enhanced Security

Currently, I am developing a web/mobile application using AJAX. This app consists of 4 pages: the login page and three protected pages that are only accessible to logged-in users. My plan is to implement the Single Page Application pattern, where all 4 pa ...

Transform a C# DateTime object into a JavaScript date format

In my Javascript function, I am handling a C# DateTime received from MVC. If the date is null, it should return "-", and if it's a valid date, it should be returned in the formatted date. IMPORTANT: The date must be sent in the specified format from ...

Generating a new date instance using a specified date string and locale settings

After scouring SO and coming up empty, I'm forging ahead with my question: I've got a date string that's dependent on locale, along with the locale info itself. For example, dateStr = '06/07/2021' and locale='en-GB'. H ...