after republish the service worker doesn't not update

Open
#189 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
nginx, rust, wasm
Domain
web-dev

Research direction

Start by inspecting the generated dist/sw.js and the Trunk configuration used with trunk build --release, then reproduce a republish behind nginx while observing the service-worker behavior. Done means the deployed page uses the rebuilt WASM without a hard refresh or manually stopping the service worker; no test file is mentioned.

Written by the indexing model from the issue text.

Description

I use this template for my project, I'm not similar to web development, so I don't know how to solve my problem.

Step1:

I build my crate with trunk build --release and put the dist directory to a nginx server.

Step2:

I modified my code and rebuild it .

after that, when I run the page, it's not updated. I find it only use my new wasm after I enter Ctrl + Shift + R to flush, or stop the service worker background manually.

I also tried to use the trunk config with hash = true to use a different wasm file name, but i don't know how to auto update the sw.js file.

How can i update the service worker after republish ?

Dominant language
Rust
Stars
1.2k
Forks
235
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from emilk/eframe_template

All issues in emilk/eframe_template

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.