Replit sometimes deletes comments in code file

Problem description:
Occasionally when I am coding using JavaScript I will save and try to run the code but it doesn’t run. When I check the code I see lots of errors in my code and realize that it has deleted some of my comments declarations (the /* */). I don’t know if it is just JavaScript but so far it hasn’t deleted the // declarations, only the /* */. this leaves big comment blocks in my code that don’t have comment tags on them. Could it just be something I am doing?

Expected behavior:
Comments don’t delete themselves

Actual behavior:
Comments sometimes delete themselves

Steps to reproduce:
So far it hasn’t been consistently doing it. just occasionally I look and it has happened while I am coding.

Browser/OS/Device:
Opera GX Browser, Windows, HP Pavillion Laptop

Sorry it formatted the text above weird, it doesn’t delete the single line comments only the multi-line comments ( /* */ )

1 Like

Is there a chance that you are hitting Ctrl + / by mistake? That is the keyboard shortcut to comment and uncomment code in the Replit workspace.

4 Likes

also make sure you haven’t accidentally set a different keyboard shortcut for toggling comments (Tools > Settings > Keyboard Shortcuts)

5 Likes

If possible, a screen recording of this issue will be much appreciated.

Please ensure you have a consistent internet connection. A flickering connection has the tendency to malform the contents of your code more than usual.

3 Likes