Code Corruption Issue

Hi, I am a beginner on three js and I am facing an issue that its code gets corrupted after few days of leaving that idle. It works fine till the time I am working on it but it gets corrupted and doesn’t perform its intended functionality. What can I do to fix this issue?

Yes - corruption and darkness, spreading throughout the innocent hearts, is a common problem within the world of development :pensive::broken_heart:

But you’d need to be more specific - what happens? What does the code do? How and where do you run it for a few days?

4 Likes

I faced multiple scenarios where my code doesn’t work well after a day or few despite the fact that I left it in stable state one day.
-One of them was that I uploaded gltf and glb models, they worked fine one day, but when on the other day, I restarted my machine, the model file got corrupted. To fix this, I had to delete the model file and placed it again in the folder.
-In second scenario, I was applying texture to my gltf model, The texture was getting changed on click. But it also stopped working after few days. Can you explain what could be the possible reason behind this glitch.

This shouldn’t really happen. Sounds like maybe a harddrive in the process of dying, or a weird operating system?

Sometimes a threejs app will break if you’re importing threejs directly from threejs.org, and they update the version. Sometimes a bad project configuration can cause mysterious behavior in the running app, but it should never like… delete files or change source code.

Remove any extensions you have running in the browser… and consider reinstalling your OS and only running a minimal set of extras, like VSCode and nothing else? That would be my approach.

1 Like

If you aren’t yet using some kind of version control, that’s a standard way to make sure that any changes to your code are tracked, and can easily be undone or repeated at a later date.

Git is the professional tool of choice for versioning (tutorial), but more hobbyist-friendly coding environments like Glitch also have features like Rewind to do the same thing.

2 Likes