Instance object’ has no attribute ‘bridge_light’

I wrote a macro

[delayed_gcode rainbow]
gcode:
    advance_led_animation
    UPDATE_DELAYED_GCODE ID=rainbow DURATION=.1

[gcode_macro advance_led_animation]
variable_r_min: 0
variable_g_min: 0
variable_b_min: 0
variable_r_max: 1
variable_g_max: 1
variable_b_max: 1
gcode:
    {% set pixel_count = 16 %}
    {% set r_step = (r_max-r_min)/pixel_count %}
    {% set g_step = (g_max-g_min)/pixel_count %}
    {% set b_step = (b_max-b_min)/pixel_count %}

    {% for pixel in range(pixel_count) %}
        {% if pixel == 16 %}
            {% set transmit = 1 %}
        {% else %}
            {% set transmit = 0 %}
        {% endif %}
        SET_LED LED=bridge_light RED={ printer["bridge_light"].color_data[pixel + 1].R } GREEN={ printer["bridge_light"].color_data[pixel + 1].G } BLUE={ printer["bridge_light"].color_data[pixel + 1].B } INDEX={ pixel } TRANSMIT={ transmit } SYNC=0
    {% endfor %}

[neopixel bridge_light]
pin: PF8
chain_count: 16
initial_red: 1.0
initial_blue: 1.0
initial_green: 1.0

That doesn’t work

!! Error evaluating ‘gcode_macro advance_led_animation:gcode’: UndefinedError: ‘instance object’ has no attribute ‘bridge_light’

Mental’s printer object search macro has saved me a few times when I got this error. I always had the wrong path in the printer object. Try adding it to your printer.cfg and running SEARCH_VARS S=bridge_light.

Example: Search Printer Objects - Macros - Klipper