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.

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

See original GitHub issue

Bug description:

Followed the instructions on https://ng-bootstrap.github.io/#/getting-started Installed ng-bootstrap: npm install --save @ng-bootstrap/ng-bootstrap Imported: import { NgbTypeahead } from '@ng-bootstrap/ng-bootstrap'; Declared: @NgModule({ declarations: [AppComponent], imports: [NgbTypeahead], providers: [], bootstrap: [AppComponent] }) export class AppModule { }

When running the app I get an error: Uncaught Error: Unexpected directive ‘NgbTypeahead’ imported by the module ‘AppModule’. Please add a @NgModule annotation.

Versions of Angular, ng-bootstrap and Bootstrap:

Angular CLI: 7.3.5 Angular: 7.2.9 ng-bootstrap:4.1.0 Bootstrap:4.3.1

@NgModule annotation is there, not sure what is wrong! Thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
pkozlowski-opensourcecommented, Mar 18, 2019

Please re-open, same documentation says

It never says imports: [NgbTypeahead] (!) - I guess you’ve meant imports: [NgbTypeaheadModule]

0reactions
akhtar030commented, Jan 22, 2021

Unexpected directive ‘NgbTypeahead’ imported by the module ‘AppModule’. Please add a @NgModule annotation.

Can anyone have a proper and exact solution for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular error: Please add a @NgModule annotation
But I get the following error: Uncaught Error: Unexpected directive 'SomeComponent' imported by the module 'SomeModule'. Please add a @NgModule ...
Read more >
Unexpected directive 'Slides' imported by the module ...
Hi! I'm trying to build a very simple app: taking pictures, saving them in an array and then displaying with a slide component....
Read more >
Unexpected directive imported by the module please add a ...
Uncaught Error : Unexpected value 'BrowserModule' imported by the module 'AppModule'. Please add a @NgModule annotation. Can someone from the Angular CLI team ......
Read more >
unexpected directive imported by the module please add a ...
Coding example for the question unexpected directive imported by the module please add a @ngmodule annotation-angular.js.
Read more >
unexpected value 'chooser' imported by the module ... - You.com
ng-bootstrap/ng-bootstrapUncaught Error: Unexpected directive 'NgbTypeahead' imported by the module 'AppModule'. Please add a @NgModule annotation.#3075.
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found