In HTML/CSS/JS Repls, any files created by a program in the shell in a subdirectory will not be hosted unless moved into the root directory and back

Problem description:
In HTML/CSS/JS Repls, any files created by a program in the shell in a subdirectory will not be hosted unless moved into the root directory and back

Expected behavior:
The files are automatically hosted without needing to be moved as described above.

Actual behavior:
You need to move the files to the root directory and back before they are hosted.

Steps to reproduce:

  1. Create a new HTML/CSS/JS repl.
  2. Make a subdirectory.
  3. Go into the shell and run echo > file.
  4. Click run and try seeing the file in the web.

Bug appears at this link:
https://replit.com/@sdft/sdft, but also on any HTML/CSS/JS repl

Browser/OS/Device:
Firefox 155.0.2/Ubuntu/Acer Aspire A114-32 series

2 Likes

I cannot reproduce this. I followed the “steps to reproduce” exactly and I was able to see the file contents fine. I created a txt file btw.

4 Likes

I suspect there’s something more to this issue, could you make a short screen recording of this issue or include some screenshots? This may help us get to the bottom of this. :smile:

3 Likes

Yeah, sorry for not doing enough testing, it seems that it’s only when a program in the shell creates files when it doesn’t host. I edited my original post.

1 Like

Something very similar happened to me the other day. I uploaded a folder from my computer and all the files were served correctly. But then I renamed the folder (using Replit’s UI) and the files weren’t accessible using the new folder name in the URL. It just showed a 404 page. The old folder name seemed to work for a while after, but eventually stopped working (probably caching).

Hey @sdft!

This issue is due to the way HTML Repls work under the hood. We use static storage to contain all of the updated files in order to serve them. Certain actions, such as editing the files or moving them between locations, will sync up with the static storage. However, actions such as renaming the files or uploading them may not be properly synced. We are aware of this issue, but we don’t have a solution at this time.

Instead, you can use the HTML Auto Refresh template that doesn’t rely on static hosting to serve your files. It uses our default dynamic hosting method which does not have the same issues as our static HTML Repls.
image

Please let me know if you have any questions!

2 Likes

hmm… extension time to move the files automatically

1 Like

ok i got something that doesn’t work and i accidentally published it

1 Like