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

Unveiling individual modules of an Angular library using public-api.ts in the latest version of Angular (Angular 13)

After completing an upgrade on my Angular library project from version 11 to 13, I encountered an issue when attempting to execute the ng build command. In version 11, the setup looked like this: I had multiple smaller modules, each containing various co ...

Tips for accurately documenting the Props parameter in a React component with Destructuring assignment

Attempting to create JSDocs for a React component using destructuring assignment to access props: const PostComponent: React.FC<IPostComponent> = ({ title, body }) => { ... } The issue arises when trying to document multiple parameters in JSDocs ...

How to prevent selection of certain days in an Angular date input

I need help with my Angular component that includes an input date field. I am trying to figure out how to disable all past dates and also a specific range of future dates, such as those between 2023-10-15 and 2023-10-23. Is there a way to achieve this func ...

Are the functionalities of twilio-common.js on github equivalent to those of twilio-client.js on their CDN?

Currently, I am integrating the Twilio SDK client from the twilio CDN using this link: //media.twiliocdn.com/sdk/js/client/v1.4/twilio.min.js However, I am interested in importing the package via npm due to some restrictions. The only option I see availa ...

Assign an array value to the input based on the selection made in Javascript

After finding a lot of useful information in previous questions, I am struggling to get the last piece that I need. My PHP code helps me loop through form fields and assign unique names to each field using a variable. One of these fields is for "expense ty ...

Utilize Next.js and GSAP to dynamically showcase images upon hovering over the title

I have a dynamic list of titles that I want to enhance by displaying images when hovering over each title. The issue I'm facing is that when I hover over one title, all the images display at once. As a React beginner, I believe the solution should be ...

What could be the reason for the emptiness of my AngularJS scope object?

The code snippet in my controller looks like this: app.controller("weeklyLogViewer", function ($scope, $http){ $scope.allLogs = {}; $http({ method: 'POST', url: '../Utilities/WeeklyLog.php', data: $scope.dateSelected, ...

TS2339 Error: The object 'Navigator' does not contain the property 'clipboard'

In the project I'm working on, there is an error that comes up when trying to copy custom data to the clipboard. It's something I can easily put together. Error TS2339: Property 'clipboard' does not exist on type 'Navigator' ...

What is the best way to exhibit information from a lone table column in a modal using Angular 7?

Is there a way to have an "edit" button beside each row in the appointments table that triggers a modal popup allowing users to change appointment dates? Unfortunately, I'm facing an issue where the modal does not pop up and my screen turns white. ** ...

How can I retrieve image files from locations outside the Angular 5 app or assets directory?

One of the features in my app allows users to upload images. I recently learned that it's best practice to store these image files outside of the app or assets folder since those folders are compiled. Here is a snapshot of my app's folder structu ...

How can you determine if a polymer element has been loaded or not?

element, I am interested in dynamically importing elements using the Polymer.import( elements, callback ) method. The callback is triggered only if the elements have not been imported yet, indicating they are already loaded. My query is: Is there a conve ...

Increasing a PHP variable after executing a JavaScript function

Imagine a scenario where we have a database containing numerous items, each with an unsigned integer id (1, 2, ...). Picture a webpage that displays all these items and allows users to add new items temporarily using JavaScript only, without affecting the ...

Loading an OBJ file from a blob using three.js

I am currently attempting to load an OBJ file from a blob using Three.js. After referring to this resource and successfully loading STL files, I encountered an issue with loading OBJ files. The error message I received is as follows: TypeError: text.indexO ...

Sending boolean values from parent components to child components in Angular 2

Is there a way to pass boolean values from a parent to child component without involving the template file? I am familiar with the normal method of communication between parent and child components using the template file, but I am not sure how to achieve ...

The source 'http://localhost:4200' is being denied access by the CORS policy when using SignalR with .NET Core and Angular

In my Angular application, I am using SignalR to fetch real-time data and a .NET Core 2.2 API for the back-end. However, upon running the project, I encounter CORS errors in the browser console. VehicleHub.cs using Microsoft.AspNetCore.SignalR; using Sys ...

Encountering a 404 error when importing http/server in deno

The file named index.ts is located below import { serve } from "https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0c3c4d4f0809e8186869e80">[email protected]</a>/http/server.ts"; function ...

Encountering a Type Error while attempting to display items from an array

Encountering an issue while attempting to load quiz questions from a db.json server. The error message reads: "TypeError: this.state.questions[this.state.currentQuestion] is undefined". In order to provide more context, here's a link to a sandbox of m ...

What could be causing the slow compilation of my Next.js pages within the app directory, and what steps can be taken to improve the speed of this

Currently, I am working on a Next.js project that uses the 'app' directory structure. However, during local development, I have been facing significant delays in compile times. Here's a breakdown of the compile times I am encountering: - Th ...

Tips for handling the final row of a CSV file in Node.js with fast-csv before the 'end' event is triggered

After using fast-csv npm, I noticed that in the code provided below, it processes the last row (3rd row) of CSV data only after triggering the "end" event. How can this issue be resolved? ORIGINAL OUTPUT : here processing request here processing re ...

While trying to set up Newman, an error message appeared saying "'newman' is not recognized as a valid command, program, or batch file."

I have Nodejs and NPM installed on my laptop, and I'm attempting to set up Newman to execute my Postman collection. However, when I type "npm install -g newman" in my terminal, I receive the following warnings: npm WARN deprecated [email protect ...