question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR in No NgModule metadata found for 'AppModule'

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No, Angular compile errrors have always been worthless. They ultimately create a toxic environment for the developer because hugh amounts of time are spent tracking them down, going into Angular Build internals, Searching Stack Overflow, Looking here, Looking there. Losing time when there’s no time to loose.

Description

I’m sure that all of these issues were caused by something I did… but why make it so difficult to fix things with poor build error messages?

I’ve hit every one of these in past two weeks! It’s stopped progress completely until each could be worked out.

This first one is what I’m stuck on now, and the final straw. It’s majorly defeating to us when we don’t have enough information to fix our own issues that only the compilers find but refuse to tell us anything.

None of these messages below are satisfactory, they tell us nothing!

ERROR in No NgModule metadata found for β€˜AppModule’

Cannot read property id of undefined

Cannot read property map of undefined

Accessor cannot be declared in an ambient context

Angular has no exported member

InjectionToken Function Calls are not supported

ERROR: Dependency @angular/animations must be explicitly whitelisted

An unhandled exception occurred: Configuration β€˜production’ is not set in the workspace

Error: self signed certificate in certificate chain - without reporting where or what to look for

Cannot find a differ supporting object…

πŸ”¬ Minimal Reproduction

I cannot minimally create a reproduction because:

  • I have no idea what the message means.
  • I’m working on a large enterprise solution.

πŸ”₯ Exception or Error


 ng build => ERROR in No NgModule metadata found for 'AppModule'

🌍 Your Environment

Enterprise App

Angular CLI: 8.3.25
Node: 12.18.0
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.25
@angular-devkit/build-angular     0.803.26
@angular-devkit/build-optimizer   0.803.24
@angular-devkit/build-webpack     0.803.26
@angular-devkit/core              8.3.25
@angular-devkit/schematics        8.3.25
@angular/cdk                      8.2.3
@angular/cli                      8.3.25
@angular/material                 8.2.3
@ngtools/webpack                  8.3.25
@schematics/angular               8.3.25
@schematics/update                0.803.25
rxjs                              6.5.4
typescript                        3.5.3
webpack                           4.39.2

Our library version we are importing

{
  "name": "mslcc",
  "version": "0.0.1",
  "peerDependencies": {
    "@angular/common": "^9.0.7",
    "@angular/core": "^9.0.7"
  },
  "description": "This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.7.",
  "main": "bundles/mslcc.umd.js",
  "author": "John Peters, Brad Sheridan",
  "license": "ISC",
  "dependencies": {
    "@angular/common": "^9.0.7",
    "@angular/core": "^9.0.7",
    "@fortawesome/angular-fontawesome": "^0.6.1",
    "@fortawesome/fontawesome-svg-core": "^1.2.27",
    "@fortawesome/free-regular-svg-icons": "^5.13.1",
    "@fortawesome/free-solid-svg-icons": "^5.13.1",
    "rxjs": "^6.5.3",
    "tslib": "^1.10.0",
    "zone.js": "^0.10.3"
  },
  "module": "fesm5/mslcc.js",
  "es2015": "fesm2015/mslcc.js",
  "esm5": "esm5/mslcc.js",
  "esm2015": "esm2015/mslcc.js",
  "fesm5": "fesm5/mslcc.js",
  "fesm2015": "fesm2015/mslcc.js",
  "typings": "mslcc.d.ts",
  "metadata": "mslcc.metadata.json",
  "sideEffects": false
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
alan-agius4commented, Jun 30, 2020

Transferred to the Angular repo for a better triage since these errors are thrown by the compiler.

0reactions
angular-automatic-lock-bot[bot]commented, Aug 8, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 : No NgModule metadata found - Stack Overflow
After upgrading to Angular 6, I encountered the "ERROR in No NgModule metadata found for 'AppModule'." with the angular-bootstrap-md package, which requiresΒ ...
Read more >
ERROR in No NgModule metadata found for 'AppModule'
You hit npm start and you get the following error: ERROR in No NgModule metadata found for 'AppModule'. You save any file again...
Read more >
Angular – All Possible Solutions for 'No NgModule' - Stack 24/7
The error "No NgModule metadata found for 'AppModule'" could be caused by various reason: Moving Angular project folder.
Read more >
No NgModule metadata found for 'AppModule' ... when trying t
When trying to serve admin-pro from IntelliJ - or issue ng serve from command line respectively - I get the error message 'No...
Read more >
ERROR in No NgModule metadata found for 'AppModule ...
I am getting [ng] ERROR while ionic serve in No NgModule metadata found for 'AppModule' this error. I searched a lot but not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found