The module for the class could not be identified during the ng build process when using the --

Encountering an error when running:

ng build --prod

However,

ng build

works without any issues.


Despite searching for solutions on Stack Overflow, none of them resolved the problem.

Error: ng build --prod Cannot determine the module for class X! Add ThreadListTabsComponent to the NgModule to fix it

Angular `ng build --prod` issue


Error message displayed below:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS D:\IT_INF_Hol_INFstructureSuite_Cit\Projects\CitH_UI> ng build --prod

Date: 2018-12-20T08:56:40.759Z
Hash: 89b0db73219a42cd9dc4
Time: 14183ms
chunk {0} runtime.ec2944dd8b20ec099bf3.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.9868d9b237c3a48c54da.js (main) 128 bytes [initial] [rendered]
chunk {2} polyfills.85f47f0bf59079cbc23a.js (polyfills) 130 bytes [initial] [rendered]
chunk {3} styles.898f3785f5d9ae4bd624.css (styles) 387 kB [initial] [rendered]
chunk {scripts} scripts.aa85510fa2abfcc665b6.js (scripts) 326 kB  [rendered]

ERROR in : Cannot determine the module for class ModelComponet in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/model/model-component.ts! Add ModelComponet to the NgModule to fix it.
Cannot determine the module for class FilterPipe in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Shared/Directives/DataTable/DataFilter.ts! Add FilterPipe to the NgModule to fix it.
Cannot determine the module for class HolCarouselComponent in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/Hol/carousel/Hol-carousel.component.ts! Add HolCarouselComponent to the NgModule to
fix it.
Cannot determine the module for class HolSolutions1Component in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/Hol/solutions/Hol-solution1.component.ts! Add HolSolutions1Component to the NgModule to fix it.
Cannot determine the module for class LogOnComponent in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/log-on/log-on.component.ts! Add LogOnComponent to the NgModule to fix it.
Cannot determine the module for class ManageConfigsCopy in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/manage-configs/manage-configs.component - Copy.ts! Add ManageConfigsCopy to the NgModule to fix it.Cannot determine the module for class TestComponent in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/test-jp/test.component.ts! Add TestComponent to the NgModule to fix it.

model-component.ts

import { Component, OnInit } from '@angular/core';
import {ModalModule} from "ngx-modal";
import { NgModule }      from '@angular/core'

@Component({
  selector: 'ngx-model',
  templateUrl: './model-component.html'
})
export class ModelComponet implements OnInit {

 // lstMenuItems:MenuEntities[];

 // constructor(private Menu_Service:MenuService,private clsmenu:MenuEntities) { }
  constructor() { }
  ngOnInit() {
   //this.loadMenu();
  }
}

https://i.stack.imgur.com/ckcvR.png

Answer №1

Could you confirm whether ModelComponent is located within a module and ensure that the module is imported in your AppModule?

The next action to take is to simplify the scenario and share additional code examples (such as HTML snippet where the component is used, AppModule configuration, feature module setup, and component TypeScript file).

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

Tips for organizing JSON data from a multiselect form

I am currently working on a template driven form with a multiselect field named assets. My framework of choice is semantic UI. <div ngModelGroup="assets"> <div class="field"> <label for="resourceName">Assets</label ...

dart, setting the root directory for web application

I'm looking to include some sample websites in my web framework package. Currently, the sites work fine when running them as Dart-only implementations, but if I need to compile them to JavaScript, I have to manually move the subfolder from my package& ...

What is the best way to set up a side-opening feature in the UI design?

I am having trouble with the Amoclan shape transitioning to the next side. I need the transition to occur exactly as specified in the documentation, but for some reason it is still moving on to the next side. <html> <head> <script src=" ...

Determining if a user is already logged in from a different device using express-session

After a user logs in, I assign the username to their session with the code: req.session.username = "...."; This identifies the session with a username, but now I need to figure out how to detect if this same username is already logged in from another dev ...

The value on the input of a custom Vue component does not update as expected when using v

I'm currently working on a custom component called customCombobox. It functions similarly to a regular v-combobox, but with an added feature - after the user presses the tab key, it automatically selects the first option available. Everything in my i ...

Troubleshooting a problem with conditional statements using AJAX and jQuery in Rails

By leveraging the power of jquery and ajax, I am able to dynamically display new tweets without having to refresh the page. However, a challenge arises when it comes to including a delete button based on whether the current user is viewing their own profil ...

What is the generic type that can be used for the arguments in

One function I've been working on is called time const time = <T>(fn: (...args: any[]) => Promise<T>, ...args: any[]): Promise<T> => { return new Promise(async (resolve, reject) => { const timer = setTimeout(() => r ...

javascript An interactive accordion component created with Bootstrap

I have been searching for a solution to create an accordion-style collapsible set of panels where the panels remain separate and do not have headers. I want buttons on one side, and when clicked, a panel is displayed on the other side. Only one panel shoul ...

What is the best way to show only one div at a time when selecting from navbar buttons?

To only display the appropriate div when clicking a button on the left navbar and hide all others, you can use this code: For example: If "Profile" is clicked in the left navbar, the My Profile Form div will be displayed (and all others will remain hidde ...

How to make a div stretch to full browser height using CSS and jQuery

I've been attempting to stretch a div to the browser's height using CSS in jQuery, but it doesn't seem to be working. I can successfully apply 100% width to the div, but height is proving to be a challenge. Any ideas why this might be happen ...

Attempting to create a sorting functionality using Vue and Typescript

I am trying to implement a feature where clicking on the TableHead should toggle between sorting by most stock on top and least stock on top. Currently, I have two buttons for this functionality, but it's not very user-friendly. My approach involves ...

Tips for invoking an Android function from an AngularJS directive?

I am facing an issue with my HTML that uses an AngularJS directive. This HTML file is being used in an Android WebView, and I want to be able to call an Android method from this directive (Learn how to call Android method from JS here). Below is the code ...

Enforce directory organization and file naming conventions within a git repository by leveraging eslint

How can I enforce a specific naming structure for folders and subfolders? I not only want to control the styling of the names (kebab, camel), but also the actual names of the folders and files themselves. For example, consider the following paths: ./src/ ...

How to eliminate a particular item within a string only in rows that include a different specific item using JavaScript

Is my question clear? Here's an example to illustrate: let string = "Test text ab/c test Test t/est ### Test/ Test t/test Test test" I want to remove / only from the line that includes ###, like so: Test text ab/c test Test t/est ### Test T ...

Tips on making Angular Material form controls dynamic

I am currently facing a dilemma where I am unsure how to dynamically set form controls. Below is the code snippet that illustrates my issue: <div [formGroup]="form"> <mat-form-field appearance="legacy"> <input matI ...

The image fails to load smoothly in the midst of an ajax operation

Here is my code snippet... div used for displaying content along with a loading image: <div id="adS" style="float: left; width: 70%"> <div id="loading-image" style="background-image: url('images/processing.gif'); display: none;"> ...

Utilizing negative values in lineTo, strokeRect, and fillRect functions

Is it possible to input negative numbers into the drawing primitives of HTML5 canvas? For instance, if I apply a translation of (100,100), would I be able to draw a rectangle or line with coordinates (-25,-25)? Initial testing using lineTo seems inconclus ...

What is the best way to store JSON data in a MySQL database?

I am facing a challenge with a JavaScript rich page that is sending a large JSON formatted data to PHP for insertion into a MySQL database. The JSON contains user input strings, some of which may include basic HTML tags like <a> and <strong>. ...

The malfunctioning of JqueryUI icon with ui-state-error within a dialog

Currently, I am facing an issue with displaying a ninput and two spans containing jQuery UI icons in a jQuery UI dialog. The problem arises specifically when applying the ui-state-error to one of the spans. Interestingly, outside the dialog, the icons dis ...

The catch-all route handler is triggered following a response being sent by a designated route handler

Currently, I am facing a peculiar issue with the routing on my Express-based server while trying to implement authentication. Here's a snippet of code that highlights the problem: app.get('/', function (req, res) { console.log('thi ...