Coder Social home page Coder Social logo

Comments (3)

amPerl avatar amPerl commented on July 18, 2024

dev tools -> application -> clear site data should fix this. not sure what exactly goes wrong in the service worker, haven't been able to reproduce

from eframe_template.

kelvie avatar kelvie commented on July 18, 2024

I've been able to get around this by commenting out the fetch eventListener code in sw.js, haven't had time to debug why (I'm on firefox/linux).

from eframe_template.

chrisdsloan avatar chrisdsloan commented on July 18, 2024

I had the same problem as OP and have a bit more information.

I had the same error message. To make sure it wasn't something I had done, I cloned eframe_template and built it as is. The first error message was complaining about eframe_template_.js. The second was complaining about the .wasm file.

What I learned is that when I did a hard reload, it would all work. When I made a change and trunk rebuilt and told the app to reload, it pulled up an index.html which had a different hash in the file name. I think that originally that file did exist, but when I cleaned everything up (trunk clean) and removed the dist directories, it was gone and was not regenerated. In fact, no files in the directory (including the target directory) referenced the hash. But again, if I reloaded (because of a change or just by pressing Ctrl-R) it would revert to that hash, which didn't exist and result in a blank gray screen.

Since the file with that name didn't exist, it looks like trunk just served my index.html as text/html. This is what caused the first error message. It was trying to interpret my index.html as javascript, seeing that it was text/html, and refusing.

Following @amPerl's advice, I brought up the dev tools, selected the "Application" tab at the top, clicked on "Storage" (for me it was not selected by default), and then selected "Clear site data". I don't remember if I just reloaded or hard reloaded at that point, but then things started working.

I wasn't able to figure out where it was getting the bogus hash from, but based on @amPerl's comment, I guess the service worker must have a reference in a cache somewhere which the "Empty cache and Hard Reload" option on Chrome's reload button did not clear.

So far, the problem hasn't recurred, but I haven't done much testing (or much development) since the fix. If I figure out what triggered in the first place, I'll report back (though there's a lot I don't know about all of this, so we'll see if I can figure anything out).

I'm not sure what my original trunk version was, but I upgrade while debugging and it now reports 0.19.2.

Outside of the eframe_template directory, rustc reports:
$ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)

In the eframe_template directory, it reports:
$ rustc --version
rustc 1.76.0 (07dca489a 2024-02-04)

(because of the rust-toolchain file).

I've been testing with eframe_template version: ab640be

Hope that helps.

from eframe_template.

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.