An issue has been encountered: No NgModule metadata was discovered for 'AppModule' in the ngx-rocket Metronic theme

Task List

  • [ ] Initialize
  • [x] Build
  • [x] Serve
  • [ ] Test
  • [ ] End-to-End test
  • [ ] Generate
  • [ ] Add
  • [ ] Update
  • [ ] Lint
  • [ ] Internationalization
  • [ ] Run
  • [ ] Configure
  • [ ] Help
  • [ ] Version
  • [ ] Documentation

Is this a regression?

This issue started occurring in the current version without any updates or upgrades.

Description of Issue

The bug has two components: one during the 'serve' command and another during build creation.

Description During Serve Process

During development, an error occurs when running npm start: "ERROR in No NgModule metadata found for 'AppModule'." Re-saving a file triggers successful compilation.

Description During Build

While building, it fails with the error: "ERROR in members.hasOwnProperty is not a function."

🔬 Steps to Reproduce

The issue occurred during development without any specific steps to reproduce.

🔥 Exception or Error

Exception during SERVE:

No other exception is present besides the error mentioned above.

Exception during BUILD:

No additional exceptions are identified, just the specified error. The following details were recorded:

(details here)

My Environment Setup

Angular CLI: 8.3.22
Node: 12.13.1
OS: Windows 10 x64
Angular: 8.2.14
... (other dependencies listed here)

Any Additional Information? Tried various reported workarounds but none have resolved the issue. Assistance would be greatly appreciated as I need to deploy the application but unable to create a production build.

Main Application File (main.ts)

(contents here)

App Module File (app.module.ts)

(contents here)

App Routing Configuration File (app-routing.module.ts)

(contents here)

Similar issue reported on Github: ERROR in No NgModule metadata found for 'AppModule'

Your assistance in resolving this matter is highly valued. Thank you for your help in advance.

Answer â„–1

It's great news that the community has identified the root cause of this issue. One major factor was an issue with the angular compiler itself. For more information, please check out these links:

Fix for NG Serve Issue

Solution for NG Build Problem

I hope this information proves useful.

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

After updating to expo 47, React Native Reanimated is continuously throwing errors

Once I made the switch to expo 47 and reanimated 2.13.0, an issue arose. A TypeError came up stating that _ReanimatedModule.default.configureProps is not a function. What's causing this error? (The specific line of code '_ReanimatedModule.default ...

Separate the label and content sections in an Angular Material vertical stepper

After applying the following CSS: mat-step-header{ display: flex ; justify-content: flex-end ; } I am attempting to make this stepper function properly. I have implemented Angular Material design for a vertical stepper. How can I position the steppe ...

A guide on retrieving data from Firestore using TypeScript

I've been diving into a chat project using Angular, and Firestore has given me a bit of trouble. Trying to get the hang of typescript while working with it. Within app.module.ts, kicking things off with: import { provideFirebaseApp, getApp, initi ...

Chokidar encountered an error in C: ode_modules: EBUSY error - the resource is either busy or locked when trying to perform a lstat operation on 'C:hiberfil.sys' file

Every time I start or restart my backend server, I encounter the following error in my terminal: Error from chokidar (C:\node_modules): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys' Error from chokidar (C:\node_m ...

When utilizing JavaScript syntax and performing API testing with Postman

Hello, I need some assistance from experts in connecting to Postman using the JavaScript code provided below. When running nodemon, the connection appears to be normal with no errors. Also, the GET request sent to Postman works fine. However, I am encounte ...

Install npm packages from a Bitbucket repository by including the team name in the Git URL

After setting up a Bitbucket repository, I aim to add it as a dependency to my Node.js project. In addition, I have developed a password app and integrated the package with the following command: npm i --save git+https://MyUser:<a href="/cdn-cgi/l/emai ...

Creating a unique ngrx operator from scratch that modifies the source observable and outputs its type

I developed a custom operator called waitFor that is being used in my effects like this: public effect$: Observable<Action> = createEffect(() => { return this.actions$.pipe( ofType(myAction), waitFor<ReturnType<typeof myActio ...

The grid gallery's sorting functionality based on image tags is not functioning properly with isotope.js and jquery

If you want to take a look at my website, it's located here: under the 'Gallery' section. The images should be neatly stacked without any gaps and they are supposed to sort when you click on the tabs at the top. To see the original theme pa ...

Encountered an issue with the core-js postinstall script, causing a failure

I encountered the following errors while attempting to install node modules in an existing Angular project. The installation is being carried out on a Windows machine (Win32 X64). > [email protected] postinstall node_modules\babel-runti ...

Syntax for nested arrow functions in TypeScript

const fetchAsyncData = (input: { value: string }): AppThunk => async (dispatch) => { try { const fetchedData = await getData({ input.value }); } catch (error) { console.log(error); } }; An error message is displayed stating "No value ...

Angular is encountering an issue where it is unable to read the value of a JavaScript function, despite the object having a value

I have developed some JavaScript functions that involve reading and writing to a JSON file, with the intention of calling them in an Angular environment (from TypeScript code) using the jsonfile library. Below is the code snippet: function savePatient(pa ...

Self-sufficient API service and online platform

I recently developed an Angular 4 application independently in Node.js and created a rest api service using dropwizard. I attempted to connect the website as a static asset for the dropwizard service, but encountered integration issues. Despite exploring v ...

Setting up state using the useState hook in a Typescript environment

At some point in the future, the state will be updated using the useState hook with an array of objects. The interface for this array of objects will look like this: export interface DataSource { dataPiont: Array<DataPoint>; } export interface Dat ...

Steps for modifying the value of a field within an Angular formGroup

Is there a way to update the value of the "send_diagnostic_data" field in a separate function? private generateForm(): void { this.messageForm = new FormGroup({ message: new FormControl(''), date: new FormControl(new Date()), messag ...

Simulate asynchronous function in imported module

Is it possible to monitor the behavior of an asynchronous function in a module that has been imported? jest.mock('snowflake-promise'); import { Snowflake } from 'snowflake-promise'; describe('Snowflake', () => { let sn ...

Having issues with parameterized URL integration between Django2 and Angular2

I am encountering an issue with integrating a URL containing parameters in Angular and Django. When making a call to the url, Django expects a slash at the end while Angular appends a question mark before the parameters. How can this be resolved? Below is ...

Examining the array to ensure the object exists before making any updates in the redux

Is there a way to determine if an object exists in an array and update it accordingly? I attempted to use the find method, but it couldn't locate the specified object. I also tried includes, but it seems to be unable to recognize the item within the ...

Google Cloud PubSub does not automatically resend unacknowledged messages

The answer chosen for this particular question contains some pertinent details I currently have a subscription set up with the following parameters: https://i.stack.imgur.com/Bn0d4.png along with the following code snippet: const subscription = this.pub ...

Executing POST calls to a Google Apps Script

Everything was running smoothly. I managed to set up an endpoint using Google Apps Script that allowed end users to send a message to me (or another contact) and receive a copy of that message as well. The code for the POST request looked something like ...

What is the correct way to specify the type in my functional component?

I was trying to define the type in my component in a different way, I know it can be done using classes but is there a way to achieve this with functional components without exporting the interface? Despite my extensive research, I couldn't find any r ...