Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular cli - Rc1 - not able to build #8

Open
vjangari opened this issue Mar 10, 2017 · 16 comments
Open

Angular cli - Rc1 - not able to build #8

vjangari opened this issue Mar 10, 2017 · 16 comments

Comments

@vjangari
Copy link

When i add Ng2PopupModule to my project and I am getting below error

ERROR in Ng2PopupModule is not an NgModule

I am using angular 2.4.X with Angular cli rc1

@allenhwkim
Copy link
Contributor

Please show your package.json and console output here.

@vjangari
Copy link
Author

vjangari commented Mar 13, 2017

{
  "name": "test-ui",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/platform-browser": "^2.4.0",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/router": "^3.4.0",
    "angular2-dynamic-component": "^1.3.15",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "ng2-popup": "^0.4.0",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0-rc.1",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ng2-overlay": "^0.7.2",
    "protractor": "~5.1.0",
    "ts-metadata-helper": "0.0.4",
    "ts-node": "~2.0.0",
    "tslint": "~4.4.2",
    "typescript": "~2.0.0"
  }
}

@vjangari
Copy link
Author

vjangari commented Mar 13, 2017

Console Output:

** NG Live Development Server is running on http://localhost:3200 **
Hash: 3118b0fe9b208b5f388f
Time: 12298ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 157 kB {4} [initial]
 [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 145 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 197 kB {4} [initial] [rendere
d]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.19 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in Ng2PopupModule is not an NgModule
webpack: Failed to compile.

@allenhwkim
Copy link
Contributor

allenhwkim commented Mar 13, 2017

Did you add Ng2PopupModule into your main.ts? Could you add your main.ts?

@vjangari
Copy link
Author

It is working if i add entry to main.ts

@vjangari vjangari reopened this Mar 14, 2017
@vjangari
Copy link
Author

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { Ng2PopupModule } from 'ng2-popup';
if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule);

@vjangari
Copy link
Author

Still getting error. Some how it worked yesterday and started getting same error again.

@allenhwkim
Copy link
Contributor

Please take look at your app.module

@NgModule({
  imports: [BrowserModule, FormsModule, Ng2PopupModule],
  declarations: [AppComponent],
  entryComponents: [],
  bootstrap: [ AppComponent ]
})
export class AppModule { }
// Compile and launch the module
platformBrowserDynamic().bootstrapModule(AppModule);

@vjangari
Copy link
Author

vjangari commented Mar 14, 2017

I have added in app.module.

@neverlose-lv
Copy link

If you edit file:
node_modules/ng2-popup/dist/ng2-popup.module.d.ts
then it works good

import { NgModule } from '@angular/core';
import { Ng2PopupComponent } from "./ng2-popup.component";
import { Ng2MessagePopupComponent } from "./ng2-message-popup.component";

@NgModule({
    declarations: [Ng2PopupComponent, Ng2MessagePopupComponent],
    exports: [Ng2PopupComponent, Ng2MessagePopupComponent]
})
export declare class Ng2PopupModule {}

@vjangari
Copy link
Author

vjangari commented Mar 15, 2017 via email

@allenhwkim
Copy link
Contributor

@vjangari please make PR for this.

@allenhwkim
Copy link
Contributor

I see. It's better to have ng2-overlay as dependencies, not devDependencies

 "dependencies": {
    "ng2-overlay": "^0.7.0"
  }

@vjangari
Copy link
Author

@allenhwkim what do you mean by PR ?

@vjangari
Copy link
Author

it did not worked even if i add dependency

@allenhwkim
Copy link
Contributor

PR: a pull request.

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

No branches or pull requests

3 participants