Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning .godot folder cause import errors that disable plugin #68615

Closed
dzil123 opened this issue Nov 13, 2022 · 3 comments · Fixed by #70668
Closed

Cleaning .godot folder cause import errors that disable plugin #68615

dzil123 opened this issue Nov 13, 2022 · 3 comments · Fixed by #70668

Comments

@dzil123
Copy link
Contributor

dzil123 commented Nov 13, 2022

Godot version

v4.0.beta4.official and v3.5.1.stable

System information

Arch Linux

Issue description

When a project has an enabled plugin that creates a custom type with an icon, when the icon is retrieved with preload, deleting the project's .godot/imported folder will show this error message popup and disable the plugin:

Unable to load addon script from path: 'res://addons/custom/custom.gd'. This might be due to a code error in that script.
Disabling the addon at 'res://addons/custom/plugin.cfg' to prevent further errors.

ERROR: Unable to open file: res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex.
   at: _load_data (scene/resources/texture.cpp:815)
ERROR: Failed loading resource: res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:214)
ERROR: Failed loading resource: res://icon.svg. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:214)
SCRIPT ERROR: Parse Error: Could not preload resource file "res://icon.svg".
          at: GDScript::reload (res://addons/custom/custom.gd:5)
ERROR: Unable to open file: res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex.
   at: _load_data (scene/resources/texture.cpp:815)
ERROR: Failed loading resource: res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:214)
ERROR: Failed loading resource: res://icon.svg. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:214)
SCRIPT ERROR: Parse Error: Could not preload resource file "res://icon.svg".
          at: GDScript::reload (res://addons/custom/custom.gd:5)
ERROR: Transient parent has another exclusive child.
   at: set_visible (scene/main/window.cpp:466)

The error messages are slightly different on 3.5.1, but there is the same "Unable to load addon script... Disabling the addon" error popup when the .import folder is deleted, but only when the plugin is enabled and the icon is retrieved with preload.

Steps to reproduce

  1. Follow the tutorial to make a plugin that creates a custom type with an icon, by passing the icon to add_custom_type.
  2. Enable the plugin.
  3. Save the project.
  4. Close the Godot editor.
  5. Delete the .godot/imported folder.
  6. Open the project in the Godot editor.
  7. The editor will show several "Unable to open file" "Failed loading resource" "Make sure resources have been imported by opening the project in the editor at least once" errors.
    • This occurs regardless of whether the script uses load or preload on the icon.
  8. If the plugin script uses preload on the icon,
    • There will be extra "SCRIPT ERROR: Parse Error: Could not preload resource file" error.
  9. If the plugin script uses preload on the icon,
    • and the plugin was enabled,
    • There will be the "Unable to load addon script... Disabling the addon" error message and the plugin will be disabled.

Minimal reproduction project

demo.zip

@fire
Copy link
Member

fire commented Nov 14, 2022

Can confirm that that deleting the ".godot" folder while Godot is running means Godot will never finish importing.

@dzil123
Copy link
Contributor Author

dzil123 commented Nov 14, 2022

To clarify, this bug happens when you close Godot, delete the .godot folder, then open Godot again.

@FakerDomain
Copy link

To clarify, this bug happens when you close Godot, delete the .godot folder, then open Godot again.

I can't find the .godot folder on MacOS, there only is a project.godot file. If I delete it, I can't event open my project, what should I do???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants