Comments (10)
Why not:
git clone https://github.com/manzonif/angular-universal-starter.git
?
from ngx-countup.
No it's ok... I was hitting errors with that command too, but I didn't see the countUp error.
When I run that in your repo I get
> [email protected] generate:prerender /Users/jamieperkins/Web-projects/GitHub/manzonif-angular-ssr
> node dist-server-express/prerender.js
Error: Cannot find module './dist-server/main.0c90f278407064dcd9f8'
Even though I see the file is there...
The fact that I am able to compile my typescript server code on my ssr demo repo makes me think it is not an issue with ngx-countUp.
Perhaps instead of using that starter project, you could use my ssr demo repo, since it works...
from ngx-countup.
Ok, so in the above mentioned project demonstrating using this package with SSR and prerendering, I am still not getting any errors, but in a separate project, I started to get the "Syntax error: unexpected token export" error and it is undeniably caused by es6 modules. I tried to make sure all the settings matched in the webpack.config file, tsconfig, etc. but the error still persisted on my other project.
And since I don't know how to reliably configure an angular project with SSR to not get this error when using es6 modules, I changed ngx-countUp to use a UMD packaged version of CountUp.
So now, from version 7.3.2
on, you should not receive this error.
from ngx-countup.
In #33 someone had the same error. Did you include countUp in scripts? You should just include CountUpModule as described in the README.
If that's not the case please provide more info about how you're including this in your project
from ngx-countup.
The issue is due to tsc compilation; no problem with webpack.
To reproduce the issue, I forked this angular universal starter, added Countup Module and configured a tsc compilation for the ts server express file.
npm run ssr-tsc
from ngx-countup.
any way you could post a zipped file of the repo somewhere (minus node modules) so I could take a look at it?
from ngx-countup.
I've spent a fair amount of time just trying to get the scripts to run on this repo and still haven't seen the countUp error. File paths in server.ts and prerender.ts were messed up and even after fixing those there are still more script errors.
from ngx-countup.
Ok, I wanted to make sure that this component was compatible with SSR so I created a repo that demos it - https://github.com/inorganik/ngx-countup-with-ssr
It uses ngx-countup in an Angular 8 project with SSR and prerendering. It builds and serves with no errors. Hope this helps.
from ngx-countup.
I'm sorry for wasting your time, but, as I said, the problem is related to tsc compilation, not webpack:
"tsc -p server.tsconfig.json"
So the correct command was:
npm run ssr-tsc
and not:
npm run ssr
However, it doesn't matter. Thanks for your help.
from ngx-countup.
Because the fix for this bug was reverted in 7.3.2, doesn't that mean this bug is still open?
I'm concerned because I plan to use this code on a project that will someday use Angular Universal.
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
- '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.