Geequlim / ECMAScript

Javascript binding for godotengine
MIT License
936 stars 84 forks source link

Condition "!is_inside_tree()" is true. #184

Open fukaraadam opened 8 months ago

fukaraadam commented 8 months ago

ECMAScript Release: 4.1-v0.0.17-alpha-20231003 Current OS: Windows 10 x64

1- When I download and launch Godot, as default there are error messages in every project (even if created new projects):

scene\gui\control.cpp:1999 - Condition "!is_inside_tree()" is true.

image

2- Furthermore, when I add simple mjs class, I had to edit and save it through Godot Editor. If Iast save made by any other editor like notepad++ or VSCode (even if created script through Godot and not edited in Godot Editor), it produces following errors:

Cannot load script in this thread Parse source code from file 'res://js/demo.mjs' failed. Failed loading resource: res://js/demo.mjs. Make sure resources have been imported by opening the project in the editor at least once.

image

image

I am not sure if second problem related to first problem, but it is especially problematic if using builder scripts like esbuild, since they produce files automatically. For second problem I have found this:

image

image

nmerget commented 6 months ago

I saw these issues in the last version as well. And to be honest TS and esbuild are the way to go. It's hard for me to fix such issues because I'm not a C++ Developer. I'll try my best to look for a solution.

nmerget commented 6 months ago

I fixed the second issue by adding additional checks: https://github.com/Geequlim/ECMAScript/pull/189