arafatamim / tally-counter

Handy tally counter, for all your counting needs.

Home Page:https://tally-counter-pwa.netlify.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

version 1.4.0: browser always reloads page after some seconds

Wikinaut opened this issue · comments

With the new framework (vite), the code shows some issues: browser reloads the page after 10 - 30 seconds or so.

I run the code behind a reverse proxy (apache2).
The 1.3.0 version does not have this problem.

Firefox shows a blank page for some 1/10 seconds, Chrome shows a short message.

Have you noticed the same problem?

This is expected because you're running the dev server which reloads the webpage every time your code changes.
Try this: npx vite preview --port 8080

You can also add it to package.json for quickly running it.

{
...
  "scripts": {
  ...
  "prod": "vite preview --port 8080"
  }
}

Them run with npm run prod.

fixed by #15

I don't understand, why it always loads your old code and not my changed one (restarted apache2, cleared chaches, rm -r node_modules,…)

Something appears to be wrong or missing your description.
I want to run my version based on your 1.4.0 as production version. npm run prod starts always a different version (yours) instead of my version. What I am doing wrong?

  • npm run serve: runs my version, but with frequent reloads
  • npx vite preview --port 8080: runs your old code (why), without frequent visible reloads, but console has
    grafik

Question: do I have to run once

npx vite build

before using

npx vite preview --port 8080

?

I want to run my version based on your 1.4.0 as production version. npm run prod starts always a different version (yours) instead of my version. What I am doing wrong?

Are you on the right working branch that has your changes in it? Use git checkout <branch-name> to switch git branch.

And yes, you have to build before running preview.