-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web page error after modifying the sample program #114
Comments
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 |
I've been able to get around this by commenting out the |
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: In the eframe_template directory, it reports: (because of the rust-toolchain file). I've been testing with eframe_template version: ab640be Hope that helps. |
Hi, more information that partially relates. Upon a fresh clone of this repo, I was not having success with After much digging, I'm pretty sure my issues are related to the latest Firefox 128.0, and the "filehash" mentioned above, although I'm having some trouble pinning it down exactly (I'm not up to speed with everything needed here yet). I sort of got the site to load locally via a different solution from above and sharing since I was not finding the following information elsewhere: In developer tools, under debugger the main error I keep getting is "NetworkError .. unable to load", this was likely due to no match on the SHA384 of embedded I tried but failed:
What did work
Ubuntu 22.04, rustc 1.76.0, trunk 0.20.2, Firefox 128.0. Developing + using terminal from VSCode 1.91.1. |
solved by disabling filehash in [build]
filehash = false |
Sorry for being away for so long. In fact, I later used local development and then deployed it to the server, and it didn't have much impact. |
I'm not very familiar with compiling to web pages.
I can run the sample program normally, but as long as I modify the title or any string in app.rs, the browser will report the following error, and it will go blank and cannot display anything. I guarantee that the modified content is correct, because everything runs normally on this machine. But it doesn't work properly on the web page. I can even open the wasm link directly and it is normal.
I have tried before
http://127.0.0.1:8080
http://127.0.0.1:8080/index.html
http://127.0.0.1:8080/index.html#dev
The results are all the same.
error message
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
The resource http://127.0.0.1:8080/eframe_template-a5ff6bdc28275b99_bg.wasm was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate
as
value and it is preloaded intentionally.The text was updated successfully, but these errors were encountered: