Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

L17.P1: uncaught script errors when running this code

Abierto
#1,443 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
godot
Área
testing

Línea de trabajo

Start by reproducing the bug: type cell = cell.y + 1 in the L17.P1 practice and check whether the SCRIPT ERROR lines appear in the output while the test still passes. The error path runs through ui/UIPractice.gd (_test_student_code around line 611, _run_if_valid around line 930) and script_checking/PracticeTester.gd (run_tests around line 72), with the failing test at course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd line 20. Done means a runtime script error during student code makes the practice fail with a visible message, and the test no longer passes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Running the following code raises script errors that are currently not captured by the testing system:

L17.P1 I can type 'cell = cell.y + 1' rather than 'cell += Vector2(0, 1)' and the robot will not move on screen, but the practice will tell me I have succeded and the robot is on the last row.

Technical information:

  • Location: L17.P1 - Introduction to For Loops > Using a for loop to move to the end of the board
  • File: res://course/lesson-18-for-loops/lesson.bbcode
  • Platform: Web
  • Commit: edde160

Code from the current practice

var board_size = Vector2(5, 5)
var cell = Vector2(2, 0)

func move_to_bottom():
    for number in range(board_size.y - 1):
        cell = cell.y + 1

Godot does raise errors in the script, but instead of being caught by the practice system like with almost all other script errors, they go to the output and the code attempts to run; in turn this abort execution of various functions and allows the practice to pass.

SCRIPT ERROR: Invalid access to property or key 'y' on a base object of type 'float'.
          at: move_to_bottom (gdscript://-9223371198983825982.gd:35)
          GDScript backtrace (most recent call first):
              [0] move_to_bottom (gdscript://-9223371198983825982.gd:35)
              [1] _run (gdscript://-9223371198983825982.gd:19)
              [2] _run_if_valid (res://ui/UIPractice.gd:930)
SCRIPT ERROR: Invalid assignment of property or key 'cell' with value of type 'float' on a base object of type 'Node2D (robot_l17_p1.gd)'.
          at: _run (gdscript://-9223371198983825982.gd:20)
          GDScript backtrace (most recent call first):
              [0] _run (gdscript://-9223371198983825982.gd:20)
              [1] _run_if_valid (res://ui/UIPractice.gd:930)
SCRIPT ERROR: Invalid access to property or key 'y' on a base object of type 'float'.
          at: test_robot_gets_to_bottom_of_board (res://course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd:20)
          GDScript backtrace (most recent call first):
              [0] test_robot_gets_to_bottom_of_board (res://course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd:20)
              [1] run_tests (res://script_checking/PracticeTester.gd:72)
              [2] _test_student_code (res://ui/UIPractice.gd:611)
              [3] _on_autotimer_timeout (res://ui/UIPractice.gd:870)
Lenguaje dominante
GDScript
Estrellas
2.8k
Forks
237
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de GDQuest/learn-gdscript

Todos los issues de GDQuest/learn-gdscript

Issues similares

Más issues de Testing & QA

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.