Coder Social home page Coder Social logo

Comments (10)

manzonif avatar manzonif commented on August 27, 2024 1

Why not:
git clone https://github.com/manzonif/angular-universal-starter.git ?

from ngx-countup.

inorganik avatar inorganik commented on August 27, 2024 1

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.

inorganik avatar inorganik commented on August 27, 2024 1

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.

inorganik avatar inorganik commented on August 27, 2024

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.

manzonif avatar manzonif commented on August 27, 2024

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.

inorganik avatar inorganik commented on August 27, 2024

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.

inorganik avatar inorganik commented on August 27, 2024

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.

inorganik avatar inorganik commented on August 27, 2024

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.

manzonif avatar manzonif commented on August 27, 2024

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.

EliezerB123 avatar EliezerB123 commented on August 27, 2024

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)

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.