Old files seen in webview, like older versions were cached. Can't see changes pulled via git

Problem description:
After successfully pulling changes via git (on any branch) for an HTML5 project, opening a new tab and navigating to the project URL shows me the project before the pull.

Expected behavior:
I would expect to see the changes brought by the commits introduced by the pull.

Actual behavior:
I can see all the changes brought by the git pull in the replit IDE, but NOT in the public URL, where the site is running. This is true on both Brave and Firefox, even after deleting private data like cookies, browser cache, etc. Or after a Ctrl+Shift+F5 refresh.

Steps to reproduce:
Create an HTML project, connect it to a git repository, make and push a commit elsewhere, pull it in replit, and then navigate to the public repl URL to see if the changes are reflected.
Note that when making a small change (say, whitespace) to any of the updated files, the public URL of the repl will now reflect the file as it is in the IDE. But, with enough files, it becomes really impractical to go through each one to make whitespace changes…

Bug appears at this link:
All my repls, for a couple of weeks now. (Before, changes used to be immediately reflected after pulls.)

Browser/OS/Device:
Windows 11, Firefox 111, Brave 1.50.119.

Welcome to the community! I assume you opened the URL in a new tab/window? The webview often does not reflect changes to the code and should not be relied upon for testing your program.

Based on their post, this is actually the opposite of what replit is doing.
Relevant quotes:

1 Like

Indeed, as @Firepup650 noticed, I’m opening the app in a new tab / window. (We can’t even test in the webview, due to some server errors about allowed origins.)

And I’m still seeing the bug now, after a couple of hours, so it doesn’t seem to be a timing issue.

1 Like

Hey @airhokey!

This issue is due to the way HTML Repls work. Because HTML Repls use static hosting under the hood, it requires you to edit the files so the Repl is aware of them in order for them to be saved in the static hosting bucket.

Two ways to get around this issue:

  1. Edit the files (e.g.: add a character then remove it) to ensure that they are recognized and updated on the static bucket
  2. Use the “HTML/CSS/JS Auto-Refresh Beta” template that uses a server instead of the static service to serve the files (removing the inconsistencies between the static bucket and the files in the Repl)
2 Likes

Thank you for the clarifying response!

Does this imply creating new repls, or can I switch existing ones to this template?

No problem! Yes, you will need to create a new Repl in order to use the Auto-Refresh template.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.