Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

AoT compiler : Unexpected value 'Ng2Bs3ModalModule' imported by the module 'SharedModule' #105

Closed
kephas123 opened this issue Sep 13, 2016 · 9 comments

Comments

@kephas123
Copy link

When i'm trying to compile AoT with ngc i get this error :

Unexpected value 'Ng2Bs3ModalModule' imported by the module 'SharedModule'

SharedModule.ts :

import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { TranslateModule } from 'ng2-translate';
import { Ng2Bs3ModalModule } from 'ng2-bs3-modal/ng2-bs3-modal';
import { RemoveHost } from './directives/remove_host.directive';
import { AuthGuard } from './guards/auth.guard';
import { GuestGuard } from './guards/guest.guard';
import { AuthService } from './services/auth.service';

@NgModule({
    imports: [CommonModule, Ng2Bs3ModalModule],
    declarations: [RemoveHost],
    exports: [
        TranslateModule,
        CommonModule,
        FormsModule,
        RemoveHost,
        Ng2Bs3ModalModule
    ]
})
export class SharedModule {

    static forRoot(): ModuleWithProviders {
        return {
            ngModule: SharedModule,
            providers: [AuthGuard, AuthService, GuestGuard]
        };
    }
}

TypeScript 2.0.2
Angular : 2.0.0-rc7 (not working either with rc6)

@kevinoleary19
Copy link
Contributor

kevinoleary19 commented Sep 15, 2016

Hey @belapie . After running into a similar problem it appears that the issue is the lack of a metadata.json file in this project. See this official angular thread for reference. Updating to the official release of Angular 2 might help. See this related issue.

@dougludlow
Copy link
Owner

dougludlow commented Sep 24, 2016

@belapie, @koleary94 - I just released v0.9.2, is this issue still present there?

@kephas123
Copy link
Author

kephas123 commented Sep 25, 2016

@dougludlow the issue is still present..

i updated to v0.9.2

Error: Unexpected value 'Ng2Bs3ModalModule' imported by the module 'SharedModule'

@galvanu
Copy link

galvanu commented Sep 29, 2016

+1

Facing the same issue in my project. I work with angular 2.0.0 and use v0.9.2 which also with angular 2
@belapie , @koleary94 - do you have any solution for this?

@dougludlow
Copy link
Owner

@belapie, @koleary94, @galvanu - try with v0.10.3. I believe I've got it working. I just needed to compile ng2-bs3-modal with the @angular/compiler-cli (ngc).

@galvanu
Copy link

galvanu commented Sep 30, 2016

@dougludlow - I updated the version and it looks like it pass this step, the problem is I have other problems in my project which fails the AoT so the build fails.
But again these are all unrelated errors to the ng2-bs3-modal so I guess building it with ngc solves this issue.
I think it is a good time for v1.0.0 ;)

@dougludlow
Copy link
Owner

@belapie, @koleary94 - any feedback?

@kephas123
Copy link
Author

@dougludlow now it's working with 0.10.4!

Thanks

@felipelvira
Copy link

Hi @dougludlow , I'm still facing this issue.
ng2-bs3-modal -v : 0.10.4
angular-cli : 1.0.0-beta.18

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants