Sign in


Sign up


MDB Angular 4.3.7 ToastService Error

MDB SupportCategory: MDB AngularMDB Angular 4.3.7 ToastService Error
Pro User asked 2 months ago in MDB pro, version:3.7

Hi,

For your information, there is a bug in the MDB Angular 4.3.7 version:

Module ‘”/src/app/typescripts/pro/index”‘ has no exported member ‘ToastService’

To correct it, you have to put in the /src/app/typescripts/pro/index.ts file:

export {
ToastService
} from ‘./alerts/’;

Best regards

dantavious Pro User replied 2 months ago

Thanks for this post. It really helped me out.

4 Answers
Dawid Adach Pro User answered 2 months ago

Dear ,

did you used a fresh copy of MDB or did you upgrade the previous version to 4.3.7 ?

In 4.3.7 we have excluded ToastService from Alerts as it has to be loaded separately as singleton. You can find more information on how to import it in our documentation as well as changelog:

ChangeLog

Please follow the instructions, otherwise, you might encounter other issues with Toast while loading MDB in multiple components

 

Dawid Adach Pro User replied 2 months ago

Guys,
please check the docs which I have placed within original answer. There was a change, you SHOULD NOT load ToastModule from import { ToastService } from ‘./typescripts/pro; , but from import {ToastService} from ‘../../typescripts/pro/alerts’

Don Irwin Pro User replied 2 months ago

 I downloaded a fresh copy of mdb-angular-pro-4.3.7.zip and get the same error 🙁

shuailiu.usa Pro User replied 2 months ago

I got exactly same error.

dantavious Pro User replied 2 months ago

I did use a fresh copy. I tried it again today and receive the following error.

ERROR in /data/code/linux/mdb-angular-pro/src/app/app.component.ts (2,10): Module ‘”/data/code/linux/mdb-angular-pro/src/app/typescripts/pro/index”‘ has no exported member ‘ToastService’.
webpack: Failed to compile.

vizmedia Pro User answered 2 months ago

The same problem occurred in my newest version.

The app.component.ts file must be changed line:

import { ToastService } from ‘./typescripts/pro;

to

import { ToastService } from ‘./typescripts/pro/alerts’;
Don Irwin Pro User answered 2 months ago

I downloaded a fresh copy of mdb-angular-pro-4.3.7.zip and get the same error.

Dawid Adach Pro User replied 2 months ago

Indeed ,
as per newest docs which I have placed within original answer. There was a change, you SHOULD NOT load ToastModule from import { ToastService } from ‘./typescripts/pro; , but from import {ToastService} from ‘../../typescripts/pro/alerts’

Don Irwin Pro User replied 2 months ago

removing `import { ToastService } from ‘./typescripts/pro;` from app.component.ts fixed this for me.

nselladu Pro User answered 2 months ago

I downloaded a 4.3.7 version. I’m getting the same error.

nselladu Pro User replied 2 months ago

I downloaded again today right now and did npm start. It is working for me now. cheers.