PWM example code does not build

I’m new to using PIO and Zephyr, but I’m attempting to build a pwm led0 example of code.

My prj.conf file is as follows:
CONFIG_PWM=y
CONFIG_PRINTK=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_LOG=y

and my main.c file is defining the PWM pin:
static const struct pwm_dt_spec pwm_led0 = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0));

I get the following compiler error:
.platformio\packages\framework-zephyr\include/zephyr/devicetree.h:236:32: error: ‘DT_N_ALIAS_pwm_led0_P_pwms_IDX_0_VAL_channel’ undeclared here (not in a function)
236 | #define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)

What am I missing?
Thanks