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

Not an ngmodule ? #4

Closed
movrack opened this issue Apr 1, 2017 · 8 comments
Closed

Not an ngmodule ? #4

movrack opened this issue Apr 1, 2017 · 8 comments

Comments

@movrack
Copy link

movrack commented Apr 1, 2017

Hi,
When I build the app I always get this message:

ERROR in Unexpected value 'NguiParallaxScrollModule in C:/.../project/node_modules/@ngui/parallax-scroll/dist/parallax-scroll.module.d.ts' imported by the module 'AppModule in C:/.../project/src/app/app.module.ts'.
Please add a @NgModule annotation.

In app.module I do the import:

import { NguiParallaxScrollModule } from '@ngui/parallax-scroll';
@NgModule({
    ...
    imports: [NguiParallaxScrollModule ]                // Note: your line in your readme look not correct.
    ...
 })
 export class AppModule { }

Any idea ?
I use angular 4.

@allenhwkim
Copy link
Contributor

Did you do npm install?
Please take a look at app directory for more.

If not working, please explain all steps what you did, or make a github repo. to reproduce this error.

@movrack
Copy link
Author

movrack commented Apr 2, 2017

I don't know what was my error but after multiple chang,e it's working know :)

@movrack movrack closed this as completed Apr 2, 2017
@movrack
Copy link
Author

movrack commented Apr 2, 2017

In fact, it's not resolved.
When I run ng serve with the import it does"nt work.
If I removed the import from the file, run any command (serve, start, build, ...) the app work (without the parallax) and then, with the live reload, I can put back the import. This is working. But it's not a usable solution for production.

In facts, it's exactly the same error as this one:

ng2-ui/sticky#5

For testing you can do this:

Install @angular/cli

ng -v
@angular/cli: 1.0.0
ng new ngParallaxScrollTest
cd ngParallaxScrollTest
npm install @ngui/parallax-scroll --save

edit src/app/app.module.ts

    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { FormsModule } from '@angular/forms';
    import { HttpModule } from '@angular/http';
    import { NguiParallaxScrollModule } from '@ngui/parallax-scroll';

   import { AppComponent } from './app.component';

  @NgModule({
    declarations: [
      AppComponent
     ],
    imports: [
      BrowserModule,
      FormsModule,
      HttpModule,
      NguiParallaxScrollModule
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  export class AppModule { }

Run ng serve or ng build
And the error is here.

ERROR in NguiParallaxScrollModule is not an NgModule

@movrack movrack reopened this Apr 2, 2017
@allenhwkim
Copy link
Contributor

allenhwkim commented Apr 3, 2017

Can you try this?
angular/angular-cli#3426

@asBrettisay, this worked for me. I was getting this error with ng2-flex-layout. Downgrading from angular-cli@1.0.0-beta.22 to angular-cli@1.0.0-beta.15 did the trick!

With angular-cli beta.24 and typescript 2.1.4 I got the same error, but when downgraded only the typescript to version 2.0.10 the error was gone.

.... and more

There are so many variables with angular-cli, which I cannot make a fix.

Sharing your solution here would be a good idea.

@movrack
Copy link
Author

movrack commented Apr 17, 2017

Sorry, I take time to try it.
Since I use angular cli 1.0.0 with angular4 and typescript setted to 2.2.0 by default, I won't downgrade them.

If I found a solution, I will post it.

@allenhwkim
Copy link
Contributor

It might be related to not having .metadata.json. I will look into that matter also.

@allenhwkim
Copy link
Contributor

complier-cli version also be a reason not to make .metadata.json files
"@angular/compiler-cli": "^2.4.9",

@allenhwkim
Copy link
Contributor

This has been updated and released as 0.5.1

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

2 participants