Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

ClarityModule is not an NgModule #220

Closed
BugsyFTW opened this issue Dec 12, 2016 · 4 comments
Closed

ClarityModule is not an NgModule #220

BugsyFTW opened this issue Dec 12, 2016 · 4 comments

Comments

@BugsyFTW
Copy link

BugsyFTW commented Dec 12, 2016

Select one ... (check one with "x")

[ x] bug
[ ] feature request
[ ] enhancement

Expected behavior

When using ng serve it should compile the app.

Actual behavior

When i type ng serve it says that the ClarityModule is not an NgModule, i've followed correctly the tutorial on installation.

** NG Live Development Server is running on http://localhost:4200. **

 10% building modules 3/3 modules 0 active(node:844) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ClarityModule is not an NgModule
 
21% building modules 94/94 modules 0 active
@adibwoy
Copy link
Contributor

adibwoy commented Dec 12, 2016

Hi @BugsyFTW. Does this happen when you use Angular-CLI version of the clarity-seed?

cc: @Shijir. It looks like an issue being raised over here: angular/angular-cli#3426

@hansl
Copy link

hansl commented Dec 12, 2016

Hi @adityarb88. I'm the lead on the Angular-CLI project.

Basically this error likely happens because you did not publish metadata.json files to npm. These files contain static information for your module and components.

To generate these files, follow these steps: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html (basically running ngc instead of tsc to build your project). You don't have to release the .ngfactory.ts files (you can use skipTemplateCodegen: true), just the metadata json files.

Cheers!

@jeeyun
Copy link
Contributor

jeeyun commented Dec 12, 2016

@hansl is right. We are actively working on supporting AoT compilation (#62) right now and plan to publish the generated metadata.json files as soon as we have it working. @BugsyFTW feel free to subscribe to the issue on AoT compilation so you'd know as soon as we have it out.

jeeyun added a commit to jeeyun/clarity that referenced this issue Dec 21, 2016
Fixes vmware-archive#62, vmware-archive#220.

Here's a refactoring of our project to support AoT compilation. Some notable changes are:
- Code changes to make our components AoT compatible:
   - make all inputs and outputs public
   - removed usage of our animation functions in components; the code is still there but not being used; for now the animation is hard-coded into the components (the ngc compiler couldn't statically analyze the functions passed into the component decorator; filed an issue to investigate separately: vmware-archive#273)
   - other minor edits to get ngc compiler to compile
- Moved demo components to under app (we previously had it nested under each component which required a lot of renaming and shifting things around to produce the npm packages)
- Reduced some of the "automagic" in our build flow:
   - renamed `src/clarity` to `src/clarity-angular`
   - no more auto re-exporting in `src/clarity-angular/index.ts` in favor of explicitly adding export statements for new components
- Now in dev mode, we no longer inline the templates for demo components (had to re-add module.id in most components to support this). this allows for the typescript compilation to not depend on sass compilation on watch tasks. Clarity components will always be inlined, even in dev mode.
- Added build step to compile our components with ngc compiler. Our clarity-angular npm package will change to include es2015 compiled code (for AoT compilation) along with `metadata.json` files, original source code in `src` folder (as before), and `clarity-angular.min.js` in register format (as before). We are now producing an additional `clarity-angular.umd.js` file. Apps using systemjs will need to update their config to use Clarity components after 0.8.0.
- No more demo npm package.

Signed-off-by: Jeeyun Lim <jeeyun.lim@gmail.com>
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants