Comments (10)
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.
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.
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.
Fixed in v6.0.0
from ngx-countup.
How are you including the countUp.js-angular2 module?
from ngx-countup.
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.
Hi again,
I think it have to do with Angular 5 and AOT.
See this link AOT
from ngx-countup.
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.
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.
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)
- Cannot update endVal and options simultanously HOT 1
- How to reset countup js? HOT 2
- Performance Improvements using zone.js HOT 3
- Extend peer dependencies to Angular 8 HOT 2
- Uncaught SyntaxError: Unexpected token export HOT 7
- Start animation when element is scrolled or is visible in viewport HOT 3
- How to add a style? HOT 1
- Error on server side rendering HOT 10
- 'kind' of undefined HOT 2
- angular 9 HOT 2
- NG build --prod failing due to "cannot read 'kind' of undefined" HOT 1
- Can't bind to 'endVal' HOT 5
- Angular 10 HOT 1
- Bugs: Wrong switching to new animation during old HOT 1
- Does not build with Angular 10 HOT 7
- Angular 13 HOT 1
- Make the animate function public HOT 2
- Angular 15 compability HOT 4
- "Works with Universal" but doesn't HOT 5
- This likely means that the library (ngx-countup) which declares CountUpModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-countup.