-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Error: SampleModule is not an NgModule #3426
Comments
Same issue on Windows10 x64 |
Yeah I can also confirm that updating |
+1 |
same here |
Been getting this in a few places. I was convinced it was my code but after trying to give it TS directly and seeing everyone complain here, I'm happy it's not just me. Probably spent a minimum of 10hrs here :) It doesn't seem to be very debuggable which is my issue. It just says: |
Had same issue with this and it is related to incompatibility of Angular versions between |
I'm getting this error with 2.2.3 having already been set. |
I tried with an example project that @beeman man provided here and updated spend a lot of time too some week ago on real world app and this solved the issue too. |
Interesting. I just installed the latest version of Angular-Cli from Github, and was able to serve the included app. I changed core and common, and received the same error message. After replacing the entire contents with the beeman's sample, and updating core and common versions, I get "must be inside an angular-cli project to use build..." Changing a few parameters to make it more general in it's operation, and removing the main: and typings: declarations didn't help... Anyone have an idea of what's causing this? I'm using node 4.x.x. Thanks. |
Hello, same issue with |
Same thing happened to me 1.0.0-beta.22 |
It seems like typescript@2.1.1 is causing the issue. Downgrading to 2.0.10 seems to make it pick up the metadata correctly. |
@lurock I encountered this bug running on TypeScript version
|
Tried to use 2.0.10, to no avail...
Get Outlook for Android<https://aka.ms/ghei36>
On Wed, Dec 7, 2016 at 4:50 PM -0600, "Bram Borggreve" <notifications@github.com<mailto:notifications@github.com>> wrote:
@lurock<https://github.com/lurock> I encountered this bug running on TypeScript version 2.0.10:
~/workspace/beeman/angular-sample-app master
? grep version node_modules/typescript/package.json
"version": "2.0.10",
~/workspace/beeman/angular-sample-app master
? tsc -v
Version 2.0.10
-
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#3426 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJTUJDxsGt_RMrdJtadUyFhJogwsN-Osks5rFzhMgaJpZM4LFF9D>.
|
Try building your project using "ng build --aot" and fix any build errors you have then go back to running "ng serve". |
This gives me very similar output.
|
Hi everyone, It has been taking me days to get a 'production' build, cause of all kind of error.. Some are typescript 2.1.1 related, some Angular 2.2.4 and some to the fact of AOT compiling. Please also take in mind, when building a production build with --aot.. That You can use all the latest versions of everything, and than not use --aot, made it work for me. |
Having the same issue after updating a project from Angular CLI 1.0.0-beta.19-3 to the latest (1.0.0-beta.22-1) on macOS Sierra. It appears that the following line is no longer returning anything in node_modules/@ngtools/webpack/src/plugin.js:330:
It looks like the instance of If I change (monkeypatch) this to the following it works (though probably not the way it should be):
|
Same thing here : yuyang041060120/ng2-validation#28 Downgrading to 1.0.0-beta.21 fix the issue |
The same issue. I am trying to start the sample app (full tour of heroes like here: https://embed.plnkr.co/?show=preview) with angular-cli 1.0.0-beta.22-1. When I remove usage of package angular-in-memory-web-api, the application not stuck in building. "dependencies": { |
Yep, just got bit by this after upgrading typescript to 2.1.4, had to revert back to 2.0.1, which is a bummer, because 2.1.4 has async/await support for es5 |
Also need this. |
Isn't this exactly the kind of thing Angular CLI is supposed to help with, making sure that all of the versions being installed fit with each other? Seems like a big fail atm. |
Just a sec ago switched Ubuntu to Win10 and made a My setup is pretty much ToH based. Running on:
|
@filipesilva or @hansl - is this something to do with angular-cli or with each of the projects themselves? Two example external deps which are giving this error for me are:
Would be nice to get your insight to if this is possible to fix in the next version as it's quite painful at the moment :) |
I'm running in Ubuntu 16.04 and recurved the same error. I followed the
suggestion above and use typescript 2.0.10 for now. It's a good work around.
That being said, I'm also using Apollo client although I fail to see how
that is relevant.
On Mon, Dec 12, 2016, 7:16 AM Dominic Watson <notifications@github.com> wrote:
@filipesilva <https://github.com/filipesilva> or @hansl
<https://github.com/hansl> - is this something to do with angular-cli or
with each of the projects themselves? Two example external deps which are
giving this error for me are:
- https://github.com/apollostack/angular2-apollo
- https://github.com/yuyang041060120/ng2-validation
Would be nice to get your insight to if this is possible to fix in the next
version as it's quite painful at the moment :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3426 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABq9MsqmBykpUW2GIb1_PfrN-4TIFnZhks5rHWU3gaJpZM4LFF9D>
.
|
ok my bad... sorry for confusion... double checked the versions... Ubuntu was running on outdated |
Getting this error as well now. Using:
Also, this error occurs even when running "ng serve", however, after the initial error, when I make changes to the code and save, the code does compile properly and runs. This error only occurs on first run of "ng serve". Finally, cannot perform "ng build --prod" because of this error. |
@expy I had it as well, I just updated from BETA to RC. After running an
|
@expy try deleting
in the project directory. |
@expy isn't using SEMVER suppose to prevent exactly that? |
Please see ERROR in PasswordStrengthBarModule is not an NgModule. The interesting twist here is that |
Been experiencing this issue in a npm package I am working on and finally managed to fix it by AOT compilation using the ngc compiler. https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#compile |
I was able to resolve this error by modifying my app.routes. I removed the hashtag reference to internal components on loadChildren routes.
|
Still run into this error with Angular 4.2.3 . Fix it with very strange @winfinit trick 😄 (angular-cli 1.1.3) |
i compiled library with |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
macOS Sierra
Versions.
Repro steps.
1. Scaffold new app:
2. Add dependency to angular-sample-module
This source to this module can be found here, and it's available on npmjs.
3. Add new module to AppModule
src/app/app.module.ts
import { SampleModule } from 'angular-sample-module';
SampleModule
to theimports
arraysrc/app/app.component.ts
<sampleComponent></sampleComponent>
to the template4. Start ng serve
The log given by the failure.
Mention any other details that might be useful.
Downgrading to the previous version of angular-cli makes it work:
Link to a sample app showing the issue: https://github.com/beeman/angular-sample-app
Using
ng new angular-sample-app
without my custom parameters on version1.0.0-beta.22
andnpm install
overyarn add
yields the same results.The text was updated successfully, but these errors were encountered: