inorganik / ngx-countUp

Animates a numerical value by counting to it - for Angular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not build with Angular 10

JulianBerger opened this issue · comments

[x ] Bug
[ ] Build issue
[ ] Feature request

Version info

7.3.2

Angular:
Angular CLI: 10.0.5
ngx-countup: 7.3.2

Description

I get a build error on ng build --prod:

ERROR in The target entry-point "ngx-countup" has missing dependencies:
 - countup.js/dist/countup.umd.js

hmm, it works for me. Do you have ngx-countup as a dependency and not a devDependency? Any more info you can provide?

i'm having same problem. currently using ngx-countup7.3.2. have tried it in dev-dependecies and dependencies. same exact error message

Temporary workaround, just install 7.3.1, it uses the regular import of countUp instead of the deep import.

npm i ngx-countUp@7.3.1

this works. thank you

commented

Yes 7.3.2 is definitely broken.

If anyone has time to help, the problem is the deep import in countup.directive.ts:

import * as countUpModule from 'countup.js/dist/countup.umd.js';

which in 7.3.1 is just

import { CountUp } from 'countup.js';

I was trying to address #37, which I couldn't repro until recently in a separate project. Webpack for SSR chokes on ES6 modules. My solution was to import from the UMD module included in countUp.

Otherwise if you know how to make SSR work reliably with this lib, then please share. Thanks!

For what it's worth, I don't get any error when building with angular 10, just a warning.

But I reverted my commit that caused the issue, Latest version 7.3.3 works for me in ng 10. Still potentially an issue with SSR as referenced above.