Capítulo 132 de 142
Motion surfaces specific, actionable error messages for common misuse. This chapter indexes the official troubleshooting entries by symptom, so you can jump straight from an error message to the fix.
| Error | Message | Fix |
|---|---|---|
| Perform animation on null (Error) | You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated. | The solution depends on the source of the error. |
| Color not animatable (Warning) | '${color}' is not an animatable color. Use the equivalent color code instead. | Convert the named color to RGBA/Hex/HSLA. |
| Complex values are too different (Warning) | Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same qua | The solution here is to ensure each string contains the same number of numbers |
| Incorrect cubic bezier length (Error) | Cubic bezier arrays must contain four numerical values. | Cubic bezier curves must only contain four points. |
| Custom component ref is not an element (Error) | motion.create() components must forward their ref to a HTML or SVG element | Ensure the ref reaches a HTML or SVG element. |
| dragConstraints ref not hydrated (Error) | If dragConstraintsis set as a React ref, that ref must be passed to another component'sref prop. | Pass the ref to another element |
| Invalid easing type (Error) | Invalid easing type '${definition}' | By defining ease as a string |
| Lazy strict mode (Error) | You have rendered a motioncomponent within aLazyMotioncomponent. This will break tree shaking. Import and render am component inst | |
| Max CSS variable depth (Error) | Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency. | Fix the circular dependency. |
| Mini animate() doesn't support type: "spring" (Error) | Mini animate() doesn't support "type" as a string. | Import spring from "motion": Or if you're creating a React animation using useAnimate: Then set type directly to the imp |
| No valid elements (Error) | No valid elements provided. | To avoid this error |
| Range length mismatch (Error) | Both input and output ranges must be the same length. | There's no good default behaviour here |
| Reduced Motion enabled (Warning) | You have Reduced Motion enabled on your device. Animations may not appear as expected. | Using the process.env.NODE_ENV variable you can disable Reduced Motion only in development mode. |
| Reorder.Item must be child of Reorder.Group (Error) | Reorder.Item must be a child of Reorder.Group | Ensure any Reorder.Item component is rendered somewhere within a Reorder.Group component: It doesn't need to be a direct |
| Reorder.Group must be provided values (Error) | Reorder.Group must be provided a values prop | |
| Repeat count too high (Error) | Repeat count too high, must be less than 20. | It's always possible to repeat an entire animation an infinite number of times. |
| Spring duration limit (Warning) | Spring duration must be 10 seconds or less | Visual duration is the amount of time an animation appears to take to reach its target |
| Spring only supports two keyframes (Error) | Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}. | Multiple keyframes will not use a spring animation by default |
| useScroll ref is not hydrated (Error) | Container/Target ref is defined but not hydrated | The ref is not correctly being passed to an element. |
| Value not animatable (Warning) | You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${invalidKeyframe}" is not an animatable value. | If this instant animation is expected |