A liquid ejecting device comprising: a support portion configured to support a medium; an ejecting unit configured to eject liquid onto the medium supported by the support portion; a detector including a plurality of sensors (P1-P6) configured to detect the medium in a detection region (R) of the support portion ; and a control unit configured to determine, based on a detection result from the detector, a first space being a space between the ejecting unit and the medium in an ejection direction (C) of the liquid from the ejecting unit, wherein the plurality of sensors include a first sensor (P1), a second sensor (P6) provided downstream of the first sensor in the ejection direction, and a third sensor (P2-P5) provided at a position between the first sensor and the second sensor in the ejection direction, the control unit is configured to determine that the first space is in an error state when the first sensor detects the medium, and to determine the first space based on a detection result of the medium when the first sensor does not detect the medium but at least one of the second sensor and the third sensor detects the medium, and each of the plurality of sensors includes a light-emitting unit (P1E-P6E) configured to emit light and a light-receiving unit (P1R-P6R) configured to receive the light, characterized in that when one side from the support portion is defined as a first region (RA) and the other side from the support portion is defined as a second region (RB) in a width direction (B) intersecting the ejection direction, in each of the plurality of sensors, one of the light-emitting unit and the light-receiving unit is disposed in the first region, and the other of the light-emitting unit and the light-receiving unit is disposed in the second region, and the light-emitting unit and the light-receiving unit are arranged alternately in each of the first region and the second region. a support portion configured to support a medium; an ejecting unit configured to eject liquid onto the medium supported by the support portion; a detector including a plurality of sensors (P1-P6) configured to detect the medium in a detection region (R) of the support portion ; and a control unit configured to determine, based on a detection result from the detector, a first space being a space between the ejecting unit and the medium in an ejection direction (C) of the liquid from the ejecting unit, wherein the plurality of sensors include a first sensor (P1), a second sensor (P6) provided downstream of the first sensor in the ejection direction, and a third sensor (P2-P5) provided at a position between the first sensor and the second sensor in the ejection direction, the control unit is configured to determine that the first space is in an error state when the first sensor detects the medium, and to determine the first space based on a detection result of the medium when the first sensor does not detect the medium but at least one of the second sensor and the third sensor detects the medium, and each of the plurality of sensors includes a light-emitting unit (P1E-P6E) configured to emit light and a light-receiving unit (P1R-P6R) configured to receive the light, characterized in that when one side from the support portion is defined as a first region (RA) and the other side from the support portion is defined as a second region (RB) in a width direction (B) intersecting the ejection direction, in each of the plurality of sensors, one of the light-emitting unit and the light-receiving unit is disposed in the first region, and the other of the light-emitting unit and the light-receiving unit is disposed in the second region, and the light-emitting unit and the light-receiving unit are arranged alternately in each of the first region and the second region. <EOS>