Coder Social home page Coder Social logo

Comments (10)

iplaksiy avatar iplaksiy commented on August 27, 2024 3

Having the same issue now that I upgraded to v6.

ng build --prod

ERROR in ./node_modules/countup.js-angular2/countUp.directive.ts
Module build failed: Error: countUp.directive.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
    at AngularCompilerPlugin.getCompiledFile 

Angular 6.0.0
Angular CLI: 6.0.0
CountUp: 1.1.1

It was building fine in v5.*, but it looks like with the upgrade, that's no longer the case.

EDIT:
In the meantime, I was able to find a workaround by adding the following to the end of tsconfig.json, just as the error suggests:

"include": [
    "./src"
  ],
  "files": [
    "node_modules/countup.js-angular2/countUp.module.ts",
    "node_modules/countup.js-angular2/countUp.directive.ts"
  ]

With that in place, my projects builds fine with ng build --prod

from ngx-countup.

valdenio avatar valdenio commented on August 27, 2024 1

The problem appears when we try to compile for production (in my case it's in Ionic, but i think it's the same problem of the others). The Angular compiler (version 5.2.9 in my case) is looking for the compiled js files, but in the npm module there are only the typescript files.

from ngx-countup.

inorganik avatar inorganik commented on August 27, 2024 1

For now, use @iplaksiy's solution. I tried rerunning a newer version of ng-packagr, and it results in an AOT error:

ERROR in : Unexpected value 'CountUpModule in /.../node_modules/countup.js-angular2/countUp.module.d.ts' imported by the module 'AppModule in /.../src/app/app.module.ts'. Please add a @NgModule annotation.

Angular still hasn't figured out a good way to pass directives around via npm. Of course, you can always just copy the count-up directive in this repo and declare it in app.module.ts. It's really that simple! But due to all the complicated webpack bundling, transpiling, etc, we have to jump through so many hoops if we want to just npm install it. * sigh *

from ngx-countup.

inorganik avatar inorganik commented on August 27, 2024 1

Fixed in v6.0.0

from ngx-countup.

inorganik avatar inorganik commented on August 27, 2024

How are you including the countUp.js-angular2 module?

from ngx-countup.

Farre82 avatar Farre82 commented on August 27, 2024

Hi,
I' m using angular 5 and is including countup.js in my sharedModule like this.

`import { CommonModule } from "@angular/common";
import { NgModule } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { CountUpModule } from "countup.js-angular2";

@NgModule({
imports: [
CommonModule,
FormsModule,
CountUpModule
],
declarations: [
],
exports: [
CommonModule,
FormsModule,
CountUpModule,
]
})
export class SharedModule { }
`

from ngx-countup.

Farre82 avatar Farre82 commented on August 27, 2024

Hi again,
I think it have to do with Angular 5 and AOT.
See this link AOT

from ngx-countup.

inorganik avatar inorganik commented on August 27, 2024

Gonna need some more info please. What angular version, cli version, and countup.js-angular2 version are you using? I successfully included it in a project using these latest (at time of writing) versions:

Angular: 5.2.0
Angular CLI: 1.6.5
count Up Angular2: 1.1.1

At the very least, make sure you have the most recent countup.js-angular2 version, 1.1.1.

from ngx-countup.

inorganik avatar inorganik commented on August 27, 2024

I am able to successfully compile my test project with ng build --prod.

In the dist folder, everything is compiled down to js.

from ngx-countup.

mjacobson7 avatar mjacobson7 commented on August 27, 2024

Any word on this? I am experiencing this as well. As @iplaksiy noted, the error message says the following:

Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).

from ngx-countup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.