-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Instant loading sometimes causes 404s on assets (e.g. images) #1638
Comments
Unfortunately, I'm very tight on time, could you provide a repository with an example that reproduces the issue? |
@squidfunk - absolutely. There you go: Switching between folder1 and folder2 will trigger 404 errors. At least it does for me. Maybe the trigger is the size of the images. Without adding the animated gif, I could not reproduce with the small images. |
Thanks! I'll look into it, but, unfortunately, it might take some time. In the meantime, you may disable instant loading. |
Yes, I was happy to see that this could be turned off. This is what I did for my docs and all is 👍. Thank you. Stay safe 🙏 |
Well, I cannot reproduce it. Tested on macOS, but that should make no difference. |
This could be the same problem that I mentioned on Gitter where my videos did not load on first page load but did after a refresh. @ojacques If you F5 the page when the problem occurs, do they show up fine? |
@Stanzilla they should load, as instant loading is first used on navigation. Again, if somebody manages to provide a case that is reproducible, I'm happy to investigate. I can't, as can be seen in the |
@squidfunk that's how I repro, go to https://docs.coregames.com/tutorials/vfx_tutorial/ then click "Video Tutorial" and then "Making a Pistol Shooter". Videos won't load. If you go to https://docs.coregames.com/tutorials/videos/pistol_shooter/ directly, they load. |
Unfortunately, I need a minimal reproducible case to debug. |
It shouldn't happen, and theoretically, it also can't happen how instant loading is implemented: mkdocs-material/src/assets/javascripts/integrations/instant/index.ts Lines 84 to 98 in 3c2c984
However, I'm not saying that there isn't a bug hiding somewhere in the code, but the behavior is synchronized now. |
You need to re-trigger initialization at |
That is strange, as I described the process shouldn't make that possible. The document is not evaluated until the path was changed. After the new path was pushed onto the history, the document is parsed and the paths are evaluated in the context of the new URL. This is the exact behavior I'm seeing. No errors. |
Can this be closed? Actually I’m still struggling to reproduce it. If somebody could provide a self-contained repository which shows the error, we can fix it, but without a reproducible case this issue is a dead-end. |
I don't know what to say. I can reproduce it with the zip file above, and I had to remove instant loading for my site for it to work. |
I would love to fix it, if I’d be able to reproduce it. I hope you understand that my spare-time is limited and I cannot invest more time into this topic without a reproducible case. Also, there seem to be very few people suffering from this problem. Maybe, somebody manages to provide a reproducible case in the future but your zip works perfectly for me. |
Also note that instant loading is still considered experimental 🐣 |
The latest
|
The mentioned fix was confirmed to work and just released as part of 5.5.12. |
First, thank you for the awesome work!
I checked that...
Description
I do have pages with several pictures on pages which are in subfolders.
When
features instant
is set inmkdocs.yml
, some of the images may not display. In the DevTools console, I see 404 errors in the network tab. I also see the 404 errors inmkdocs
stdout.Refreshing the page does display the images.
Expected behavior
Images should display without having to refresh.
Actual behavior
Images do not display (not systematically), and getting 404 errors in the DevTools Network tab.
Steps to reproduce the bug
mkdocs serve
Package versions
python --version
: 3.7.5mkdocs --version
; mkdocs, version 1.1pip show mkdocs-material | grep -E ^Version
: version 5.1.1Project configuration
System information
The text was updated successfully, but these errors were encountered: