Closed sbroways closed 7 years ago
Same after upgrading Angular to 2.4.1 and typescript to 2.0.3.
This appears to be an issue with multiple angular components.
I'm going to try switching from Typings to @types/ and see if that resolves my issue.
Same problem. Using Angular 2.3.1 and typescript 2.0.3
Sorry for the delay, folks. At the moment I'm traveling so I don't have time and opportunity to fix this issue. I'll take a look when I'll get back home. Sorry for that!
Same issue appears with @angular/cli version 1.0.0
i'm also
it temporarily worked when I reinstalled it npm install angular2-flash-messages --save
, now it doesn't again, and reinstalling doesn't help. I just upgraded to angular 4 a few days ago, but it worked until now
I have also just noticed this error, everything is working fine under dev env, however, once i attempt to compile the application it throw this error during the build process... any help is appreciated.
Here is my ng environment: @angular/cli: 1.0.0 node: 7.3.0 os: darwin x64 @angular/common: 4.0.1 @angular/compiler: 4.0.1 @angular/core: 4.0.1 @angular/forms: 4.0.1 @angular/http: 4.0.1 @angular/platform-browser: 4.0.1 @angular/platform-browser-dynamic: 4.0.1 @angular/router: 4.0.1 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.1
Update: I retried installing the latest angular2-flash-messages (1.0.7), and figured to change the private variable in my component's constructor from "constructor(private _flashMessagesService: FlashMessagesService)" to "constructor(private flashMessagesService: FlashMessagesService)." I copied the constructor's syntax from the angular2-flash-messages npm package webpage, and simply deleted the underscore before flash. Also, I added to my app.component.html the
I also upgraded my angular to 4.0.0 and installed the latest angular2-flash-messages (1.0.7), and faced the exact same error of "FlashMessagesModule is not an NgModule." So, I tried downgrading my angular2-flash-messages to version 1.0.5 only, and it seems to work fine. I do, however, get a few warnings that says that this version of angular2-flash-messages requires a peer of angular 2.4.10, basically a version below 4.0.0. I'll post any future errors that I encounter because of it, too.
@raman-chand i removed the underscore before flashMessagesServices as you said. then i did flashMessagesServices.show in ngOnInit() but i still got the same Error. just refreshed the page and all worked fine. i really don't know what happend. i still get the error but everything works :c
@ZiedChekir so I don't have any input in my ngOnit(){}. It's empty. I read on the angular2-flash-messages npm documentation that we needed to include flash messages as a private variable as a parameter in the constructor. So: constructor(private flashMessage: FlashMessagesService){} - is how I wrote it - in the component you're inputting flash messages module into, in addition to the import command. When you do this.flashMessagesServices.show(), is "flashMessagesServices" the name of the private variable you created? I'd check the spelling.
Also, I still have a buggy experience with the latest flash messages in angular 2, so it's not totally resolved.
i was just experimenting with NgOnInit(). the spelling doesnt matter with underscore or without it. i actually still get the Error FlashMessagesModule is not an NgModule any time i ng serve but it is ignored when the page is refreshed. i agree that you something is still buggy but hope we will find a sollution
Also getting the same error. How do I fix this?
Having exact the same error, the weird thing is when I change 1 line of code in my editor and save the file again I don't have the error when it recompiles.
`> ng serve
As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release, which will only support Node 6.9 and greater. This package will be officially deprecated shortly after.
To disable this warning use "ng set --global warnings.packageDeprecation=false".
fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" fallbackLoader option has been deprecated - replace with "fallback" loader option has been deprecated - replace with "use" NG Live Development Server is running on http://localhost:4200. Hash: 7cbe0ff3bb1e02e8e0c0 Time: 12615ms chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 231 kB {4} [initial] [rendered] chunk {1} main.bundle.js, main.bundle.map (main) 33.5 kB {3} [initial] [rendered] chunk {2} styles.bundle.js, styles.bundle.map (styles) 9.71 kB {4} [initial] [rendered] chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.59 MB [initial] [rendered] chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in FlashMessagesModule is not an NgModule webpack: Failed to compile. Here I did edit 1 file and hit save again webpack: Compiling... Hash: 7cbe0ff3bb1e02e8e0c0 Time: 2431ms chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 231 kB {4} [initial] chunk {1} main.bundle.js, main.bundle.map (main) 33.5 kB {3} [initial] chunk {2} styles.bundle.js, styles.bundle.map (styles) 9.71 kB {4} [initial] chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.59 MB [initial] chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] webpack: Compiled successfully.`
Gabriel Amazonas Mesquita wrote a great solution to the problem: http://stackoverflow.com/a/43214791
@sbroways I've just tested latest package version(1.0.8) with Angular CLI and it works fine. Let me know, if you still experience this issue
It's resolved. Thank you!
Thanks to all for a feedback!
Hi @moff i have installed npm angular 2 flash messages but its not integrating in my project compiler says cant resolve flashmessagesmodule
I have latest version of angular2-flash-messages module but I am still facing bellow problem. ERROR TypeError: this.flashMessagesService.show is not a function Please help me.
I am getting an error "ERROR TypeError: this._flashMessagesService.show is not a function". I am using version "2.0.8" with angular-cli version 4.0.0.
Please help.
Please fix this issue, thanks in advance
"ERROR TypeError: this._flashMessagesService.show is not a function" - same error!
"FlashMessagesModule.forRoot returns a ModuleWithProviders type without a generic type argument." - Angular CLI version: 9.0.3
Flash Messages had been working fine on my app and then suddenly started throwing an error: FlashMessagesModule is not an NgModule
errors @ client?93b6:80 sock.onmessage @ socket.js:37 EventTarget.dispatchEvent @ eventtarget.js:51 (anonymous) @ main.js:274 SockJS._transportMessage @ main.js:272 EventEmitter.emit @ emitter.js:50 WebSocketTransport.ws.onmessage @ websocket.js:35 wrapFn @ zone.js:889 ZoneDelegate.invokeTask @ zone.js:275 Zone.runTask @ zone.js:151 ZoneTask.invoke @ zone.js:345
I've tried importing using both: import { FlashMessagesModule } from 'angular2-flash-messages'; and: import { FlashMessagesModule } from 'angular2-flash-messages/module';
I followed the directions here for installation. Thanks for help.