Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

L17.P1: uncaught script errors when running this code

Open
#1,443 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
godot
Domain
testing

Research direction

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.

Written by the indexing model from the issue text.

Description

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)
Dominant language
GDScript
Stars
2.8k
Forks
237
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GDQuest/learn-gdscript

All issues in GDQuest/learn-gdscript

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.