logo
down
shadow

Uncaught Error: Unexpected value 'SharedModule' imported by the module 'AppModule'. Please add a @NgModule annotation


Uncaught Error: Unexpected value 'SharedModule' imported by the module 'AppModule'. Please add a @NgModule annotation

By : Dawid Mazurkiewicz
Date : October 16 2020, 03:08 PM
I hope this helps . I find a solution after some searching on Google.
It seem to be a problem in angular-cli webpack. Refer to this link for more details : https://github.com/webpack/webpack/issues/3148
code :


Share : facebook icon twitter icon
Uncaught Error: Unexpected directive 'MyComboBox' imported by the module 'AppModule'. Please add a @NgModule annotation

Uncaught Error: Unexpected directive 'MyComboBox' imported by the module 'AppModule'. Please add a @NgModule annotation


By : Andrea D.
Date : March 29 2020, 07:55 AM
I wish this helpful for you EDIT :
This error frequently comes up when we are not importing, providing, or declaring the angular modules, services, components properly.
code :
@NgModule({
      declarations: [
      AppComponent,
      MyComboBox
     ],


    imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    DragulaModule,
    CoreModule
   ],
  // viewProviders: [ DragulaService ],
  providers: [HelperService],
  bootstrap: [AppComponent]
})
Uncaught Error: Unexpected value 'PropDecoratorFactory' imported by the module 'AppModule'. Please add a @NgModule annot

Uncaught Error: Unexpected value 'PropDecoratorFactory' imported by the module 'AppModule'. Please add a @NgModule annot


By : Zsoldi Robert
Date : March 29 2020, 07:55 AM
This might help you I'm building a simple AngularJS 2/s app, and I try to pass a variable from a nested child component to the parent component, so the parent can change it, like so: , You shall remove ViewChild from list of imports in AppModule.
code :
imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    ViewChild <--- Remove this one
  ],
Uncaught Error: Unexpected value 'AngularFireDatabase' imported by the module 'AppModule'. Please add a @NgModule annota

Uncaught Error: Unexpected value 'AngularFireDatabase' imported by the module 'AppModule'. Please add a @NgModule annota


By : İrem Hocaoğulları
Date : March 29 2020, 07:55 AM
it fixes the issue I think yon need to change your imports to replace AngularFireDatabase with AngularFireDatabaseModule:
code :
  imports: [
    ...
    AngularFireDatabaseModule 
  ],
import { AngularFireDatabaseModule } from "angularfire2/database";
Error: Unexpected directive 'DashboardPage' imported by the module 'SharedModule'. Please add a @NgModule annotation

Error: Unexpected directive 'DashboardPage' imported by the module 'SharedModule'. Please add a @NgModule annotation


By : Keerthi R
Date : March 29 2020, 07:55 AM
this will help I am trying to use DashboardPage in app.module.ts file as shared module, In that I am facing error like "Error: Unexpected directive 'DashboardPage' imported by the module 'SharedModule'. Please add a @NgModule annotation." , You mixed up all the attributes:
code :
declarations: [
    PROVIDERS
],
imports: [
    CommonModule,
    DashboardPage,
],
exports: [
    DashboardPage,
]
Error: Unexpected value 'HttpClient' imported by the module 'AppModule'. Please add a @NgModule annotation

Error: Unexpected value 'HttpClient' imported by the module 'AppModule'. Please add a @NgModule annotation


By : Lexy Noreli
Date : October 08 2020, 05:00 AM
Any of those help Error: Unexpected value 'HttpClient' imported by the module 'AppModule'. Please add a @NgModule annotation. , You need import HttpClientModule, example:
code :
 import { HttpClientModule } from '@angular/common/http';

 @NgModule({
   imports: [
     BrowserModule,
     // import HttpClientModule after BrowserModule.
     HttpClientModule,
  ],
  declarations: [
     AppComponent,
  ],
  bootstrap: [ AppComponent ]
})

export class AppModule {}
Related Posts Related Posts :
  • What is the difference between formControlName and FormControl?
  • Angular 2 route is getting loaded into the top level router-outlet despite having a specified router-outlet defined on t
  • Angular2 with matrix url notation
  • RxJS Refactor nested map statement
  • Angular - *ngFor not showing data
  • Typescript Error: Type 'any' is not a constructor function type
  • Angular2 - getting a TemplateRef inside a service
  • Integrating Angular Universal into existing CLI Applications
  • Why even use sessionStorage in Angular?
  • Why does [disabled]="canDisable" will not work for Angular2 reactive forms
  • Style backgroundColor p-fileUpload primeNG
  • Angular4 Dependency Injection: what am I doing wrong?
  • Appending string to img src in angular 4
  • how to open ng bootstrap modals from another component?
  • angular2 transition animation is not working
  • AdminLTE - data-widget="tree" - Open menu by default
  • How to implement one interface in an other
  • Executing resolvers one after the other in Angular 2+
  • Login redirect a user with Azure AD B2C from an Angular application and msal.js
  • add button into google maps Angular2
  • Integrating Firebase admin with Angular 4 project
  • Calling services in the correct order in Angular 4?
  • Angular 2: How to handle http oauth authtoken 401 errors on a global basis
  • Implement Validators.required in a custom component
  • Testing an async injectable service
  • How to change angular 4 property on click event?
  • Angular 4 - Lazy Loading routes doesn't work
  • Angular - Filter ngFor data array of objects
  • How to get current authenticated user angularfire2 (angular) so that it is usable in time for class methods?
  • data passed with resolve(x) is received as undefined
  • Can't get local storage value on initial page load
  • Angular 2 Route Aliases
  • angular 4 reusable component and template
  • Tslint - type trivially inferred - Why is it bad practice to include the type here?
  • Angular 4 "Property does not exist on type component"
  • Connecting angular to firebase using angularFire2 version 5.0
  • Angular 4 Timer up ticking too fast
  • How to do form validation for a select box?
  • Access async object param into child component in Angular 4
  • Ionic How to implement pressing,release,drag,drop event of button?
  • Angular not pulling data through Angularfire2
  • How to set a value from observable to a variable in Angular 2
  • Get Grand Total From Rows Total
  • Angular - Does importing unnecessary ngModules increase file size if they have been imported elsewhere?
  • Capture requests globally in angular 4 and stop if no internet
  • How to return the promise then()/catch() result to the function containing the promise?
  • Using third party libraries (MxGraph) in angular 4, without installing them from npm
  • Angular: Run canActivate on each route change
  • angular: how to loop for numbers?
  • Preventing a Pyramid of Doom using rxjs .subscribe with Angular - flattening the number of .subscribes
  • Angular 4 Http Chain Requests
  • Obtaining references to all directives of a certain type up the component tree
  • using third party library in angular
  • How to access to an ngModel element inside a reusable component
  • Angular 2 change sidenav content depending on the current router state
  • How to retrieve the data only if the subscride processing is completed
  • Angular 2 transfer variable from one template to another
  • Looping ng-template is showing wrong template when using *ngIf and ng-content
  • Using ConnectableObservable instead of DataSource in mat table
  • Getting component inside component which is declared in HTML template
  • shadow
    Privacy Policy - Terms - Contact Us © soohba.com