Parse error deleting my scripts

Version 4.2.2

Yesterday I encountered a dependency bug. I was downloading something large at the time so I deleted the file I was downloading and rebooted godot. The dependency error was gone but some of my code disappeared. When I try to load the subscene it says “Error while loading file” and the output tells me

“scene/resources/resource_format_text.cpp:1047 - res://Sub Scenes/Militia.tscn:1 - Parse Error:”

and

“Failed loading resource: res://Sub Scenes/Militia.tscn. Make sure resources have been imported by opening the project in the editor at least once.”

an old forum told me to open one of the tscn in text and that it’s probably missing a bracket on the first line. I checked everything and they seems fine.

I don’t think this is a circular dependency problem since the subscene wasn’t referenced anywhere.

Thanks you in advance.

May I ask how large this file is? Parsing errors are usually caused by saving a large file. The solution is to manually edit the file and delete unnecessary data from it

My game is pretty small at the moment. The file I tried to download was totally unrelated with Godot, but it was large enough to take out most if not all of my storage. I opened Godot before I deleted the file so that’s when the dependency error popped up.

if its small enough, post the texts here as a reply and Ill check it out

Sorry for asking, but would you clarify what you mean by text?

ctrl+c to copy your script, ctrl+v to paste it in the forum, preferably like so, between three ticks or a [code] tag

```
type or paste code here
```

Though to me it sounds like something important was deleted, can you “open anyway” or fix the dependency?

1 Like

go find the .tscn file in your computer, it should be in the folder of your godot project. right click it, open in notepad, copy and paste the text here. There’s also a button to upload files to this website too

the dependency error is gone but I can’t open some of my sub scenes without getting an error. Some of my scripts are also completely gone.

Yea I tried this last time, most of my tscns that was affected doesn’t have anything on the notepad. For the scene that I was able to open (though it’s still missing the script and some assets), I checked the notepad for it and it looked fine, but I can still send it if you need me to.

Am I cooked…?

It sounds like more than one file has been deleted, if you know which files you may be able to remove the offending lines with a text editor, but you will face some amount of data loss.

If you want to upload your project folder somewhere I’d be happy to lend a helping hand recovering scene and resource files this way.

Try looking into a version control system, like git to prevent redundant data loss next time.

ahh thanks for the advice, I think I can quickly catch up to where I left off if I start a new project instead.

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