Sw dev fix #3

Open
nathan wants to merge 20 commits from sw-fix into lotus
Member

Fixed service worker registration when running in a development environment

Fixed service worker registration when running in a development environment
nathan added 3 commits 2026-08-02 18:35:57 -04:00
image path changes, for dev setup, needs testing on 'prod'
CI / Build & Quality Checks (pull_request) Failing after 6m0s
CI / Trigger Desktop Build (pull_request) Skipped
2bbd390a3b
read me updates with instructions for running a dev server
CI / Build & Quality Checks (pull_request) Failing after 5m54s
CI / Trigger Desktop Build (pull_request) Skipped
6a0037ecec
fix problem registering service worker when in a development environment
CI / Build & Quality Checks (pull_request) Canceled after 1m37s
CI / Trigger Desktop Build (pull_request) Canceled after 0s
093f10db5c
nathan added 1 commit 2026-08-02 18:37:35 -04:00
removed test change
CI / Trigger Desktop Build (pull_request) Skipped
CI / Build & Quality Checks (pull_request) Failing after 6m1s
149ea96957
nathan added 1 commit 2026-08-02 19:00:45 -04:00
fixed retarded prettier 'error'
CI / Trigger Desktop Build (pull_request) Skipped
CI / Build & Quality Checks (pull_request) Failing after 6m2s
50bb509484
jared requested review from jared 2026-08-02 19:46:07 -04:00
Owner

Re-reviewed at head 50bb5094. The core fix is right and worth landing — registering the dev SW with { type: 'module' } is correct (/dev-sw.js is an ES module under VitePWA's devOptions, so the old
registration threw in dev), and the try/catch + logging is a nice touch. But npm run lint is currently red (8 eslint errors):

  1. Remove import { register } from 'module'; (src/index.tsx). It's Node's built-in module pulled into a browser bundle, and it's unused — you call your own registerServiceWorker. It's causing two of the
    errors (@typescript-eslint/no-unused-vars + import/order). Deleting it also removes the need for the /* eslint-disable import/first */ you added at the top — please drop that disable and fix the placement
    rather than silencing the rule.

  2. void registerServiceWorker(); trips no-void. Call it directly (the function already has its own try/catch) or handle the promise with .catch(...).

  3. Rebase onto current lotus. This branch is stacked on the image-path commit, so it also carries that change — the root-URL prod-404 from #1 plus import/newline-after-import on the logo consts. Rebasing
    drops all of that and leaves this PR as just the SW fix.

Once it's only the SW-registration change on a clean base with npm run lint + npx tsc --noEmit green, this is a clear merge. 👍

Re-reviewed at head 50bb5094. The core fix is right and worth landing — registering the dev SW with { type: 'module' } is correct (/dev-sw.js is an ES module under VitePWA's devOptions, so the old registration threw in dev), and the try/catch + logging is a nice touch. But npm run lint is currently red (8 eslint errors): 1. Remove import { register } from 'module'; (src/index.tsx). It's Node's built-in module pulled into a browser bundle, and it's unused — you call your own registerServiceWorker. It's causing two of the errors (@typescript-eslint/no-unused-vars + import/order). Deleting it also removes the need for the /* eslint-disable import/first */ you added at the top — please drop that disable and fix the placement rather than silencing the rule. 2. void registerServiceWorker(); trips no-void. Call it directly (the function already has its own try/catch) or handle the promise with .catch(...). 3. Rebase onto current lotus. This branch is stacked on the image-path commit, so it also carries that change — the root-URL prod-404 from #1 plus import/newline-after-import on the logo consts. Rebasing drops all of that and leaves this PR as just the SW fix. Once it's only the SW-registration change on a clean base with npm run lint + npx tsc --noEmit green, this is a clear merge. 👍
nathan added 3 commits 2026-08-02 20:07:00 -04:00
fixed retarded linter problem
CI / Build & Quality Checks (pull_request) Failing after 6m2s
CI / Trigger Desktop Build (pull_request) Skipped
b2376513fd
fixed retarded prettier 'error'
CI / Build & Quality Checks (pull_request) Successful in 10m45s
CI / Trigger Desktop Build (pull_request) Skipped
0aef410f60
Merge remote-tracking branch 'origin/image-path-changes' into sw-fix
CI / Build & Quality Checks (pull_request) Failing after 6m1s
CI / Trigger Desktop Build (pull_request) Skipped
f6d66af280
nathan added 1 commit 2026-08-02 20:30:21 -04:00
Merge remote-tracking branch 'origin/lotus' into sw-fix
CI / Trigger Desktop Build (pull_request) Canceled after 0s
CI / Build & Quality Checks (pull_request) Canceled after 2m37s
c1ec68e73e
nathan added 1 commit 2026-08-02 20:46:15 -04:00
removed commitizen, added eslint package back
CI / Trigger Desktop Build (pull_request) Canceled after 0s
CI / Build & Quality Checks (pull_request) Canceled after 0s
f1e4ef657c
nathan added 1 commit 2026-08-02 20:48:12 -04:00
linter doesnt like void
CI / Trigger Desktop Build (pull_request) Canceled after 0s
CI / Build & Quality Checks (pull_request) Canceled after 0s
2d5e90f715
nathan added 1 commit 2026-08-02 20:49:36 -04:00
removed warning for 'any' as a type from eslint
CI / Trigger Desktop Build (pull_request) Canceled after 0s
CI / Build & Quality Checks (pull_request) Canceled after 0s
89ba05f462
nathan added 1 commit 2026-08-02 20:55:48 -04:00
removed eslint unused ignore lines, config handles ignoring it now
CI / Trigger Desktop Build (pull_request) Canceled after 0s
CI / Build & Quality Checks (pull_request) Canceled after 0s
0656e6ecb0
nathan added 1 commit 2026-08-02 21:00:27 -04:00
removed unused eslint-disables, ran prettier fix
CI / Trigger Desktop Build (pull_request) Canceled after 0s
CI / Build & Quality Checks (pull_request) Canceled after 0s
a1bdaf65f6
nathan added 1 commit 2026-08-02 21:02:04 -04:00
added prettier auto-fix to pipeline
CI / Trigger Desktop Build (pull_request) Canceled after 0s
CI / Build & Quality Checks (pull_request) Canceled after 1m19s
9b10d7d1c2
nathan added 1 commit 2026-08-02 21:03:45 -04:00
added restriction to lint only ts,js files
CI / Trigger Desktop Build (pull_request) Skipped
CI / Build & Quality Checks (pull_request) Failing after 5m57s
c8475f07aa
nathan added 1 commit 2026-08-02 21:10:46 -04:00
Merge remote-tracking branch 'origin/lotus' into sw-fix
CI / Trigger Desktop Build (pull_request) Skipped
CI / Build & Quality Checks (pull_request) Failing after 6m7s
b90c3b7313
nathan added 1 commit 2026-08-02 21:39:21 -04:00
fix ci prettier mistake
CI / Trigger Desktop Build (pull_request) Skipped
CI / Build & Quality Checks (pull_request) Successful in 10m57s
f207da2344
nathan added 1 commit 2026-08-02 21:58:27 -04:00
added another package back in
CI / Trigger Desktop Build (pull_request) Skipped
CI / Build & Quality Checks (pull_request) Successful in 10m51s
be004411c3
nathan added 1 commit 2026-08-02 22:21:37 -04:00
i hate npm audit
CI / Trigger Desktop Build (pull_request) Skipped
CI / Build & Quality Checks (pull_request) Successful in 11m36s
3f37f69a13
Owner

Claude Sonnet 5 btw

The SW fix itself is in good shape now — the stray import { register } from 'module' is gone, no-void is resolved, and the { type: 'module' } dev registration is correct. That part's a clean merge. 👍

The problem is scope: this PR has grown to 31 files and bundles several unrelated changes, two of which can't ship:

  1. CI change neuters the prettier gate. npx prettier --write . before check:prettier means the check can never fail (it auto-fixes the ephemeral CI checkout, which isn't committed back) — so unformatted
    code passes CI and deploys. Please drop this; formatting is already handled by the pre-commit hook on lotus, and the ci.yml here also conflicts with lotus.
  2. @giphy/js-util 5.2.0 → 2.0.0 is a major downgrade that will likely break the GIF picker — please restore 5.2.0.
  3. Image-path change (vite.config.js publicDir, root /Lotus.png) is already fixed on lotus (f2c356f2, using /public/res/ — verified prod-safe) and 404s in prod as written. It's what's blocking the merge.
  4. The no-explicit-any: off + eslint-disable removals and commitizen removal are real policy/tooling decisions — worth their own PR + discussion, not bundled here.

Suggested path: rebase onto current lotus and reduce this PR to just src/index.tsx (the SW fix). Open separate PRs for the eslint-policy change and any dependency bumps so each can be reviewed on its own.
The SW fix will merge cleanly once it's standalone on a current base.

**Claude Sonnet 5 btw** The SW fix itself is in good shape now — the stray import { register } from 'module' is gone, no-void is resolved, and the { type: 'module' } dev registration is correct. That part's a clean merge. 👍 The problem is scope: this PR has grown to 31 files and bundles several unrelated changes, two of which can't ship: 1. CI change neuters the prettier gate. npx prettier --write . before check:prettier means the check can never fail (it auto-fixes the ephemeral CI checkout, which isn't committed back) — so unformatted code passes CI and deploys. Please drop this; formatting is already handled by the pre-commit hook on lotus, and the ci.yml here also conflicts with lotus. 2. @giphy/js-util 5.2.0 → 2.0.0 is a major downgrade that will likely break the GIF picker — please restore 5.2.0. 3. Image-path change (vite.config.js publicDir, root /Lotus.png) is already fixed on lotus (f2c356f2, using /public/res/ — verified prod-safe) and 404s in prod as written. It's what's blocking the merge. 4. The no-explicit-any: off + eslint-disable removals and commitizen removal are real policy/tooling decisions — worth their own PR + discussion, not bundled here. Suggested path: rebase onto current lotus and reduce this PR to just src/index.tsx (the SW fix). Open separate PRs for the eslint-policy change and any dependency bumps so each can be reviewed on its own. The SW fix will merge cleanly once it's standalone on a current base.
All checks were successful
CI / Build & Quality Checks (pull_request) Successful in 11m36s
CI / Trigger Desktop Build (pull_request) Skipped
This pull request has changes conflicting with the target branch.
  • .gitea/workflows/ci.yml
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin sw-fix:sw-fix
git checkout sw-fix
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#3