So you just have one wire in the box? ie it is a switch leg? Most dimmer switches and definitely connected ones will require a Neutral wire, which you don’t have at that box in that case.
Might be the same issue as over here:
However I am not sure you can work around it if the dimmer has to be in the box…