None of my javascript resources are being imported after attempting to move files into folders

I attempted to organize a few of my files into different folders. In the end I decided to revert to an older version where none of the files are in folders.

Ever since then, when I hit run things are not working. It seems like none of my javascript resources are being imported and I am getting a 404 for each resource in the console. log

https://replit.com/@AlexandrosMatho/Canvasai

1 Like

https://replit.com/@AlexandrosMatho/Canvasai?v=1

1 Like

Hey @AlexandrosMatho! Welcome to the community!

You will need to put double quotes around the file paths to your Javascript files in the <script> tags. Here is an example for your first file:

<script type="module" src="variables.mjs"></script>
2 Likes

Thank you! Tried that, but still not working : (

You added spaces in between your attributes and values. I don’t advise doing so, as it may create errors and unforeseen outcomes.

So, remove the spaces between them and I believe it should work properly.

1 Like

seems the JS files weren’t registered as they were server authored. Make a change in the editor to each of them, then ‘Run’, then it should work

3 Likes

Worked! Any idea why this happened and if there is something i can do in the future to make sure it does not again?

you would’ve used something like git to revert the changes, so the changes were made programmatically and the new files created weren’t registered when you hit ‘run’.
As for preventing, all I can think of is to move to an auto-refresh repl which doesn’t use static hosting like the HTML template. This template can also be convenient but note that it requires you to wait for the repl to wake up before visiting when the website goes inactive.

1 Like

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