See /src/page.tsx for the simple code reproduction example.
yarn installyarn dev- Navigate to http://localhost:3001
Expected: Page loads
Actual: SSR render hangs forever
- Replace
rightIconwithrightIconMemoizedOR - Patch
<Button>with the code fix below.
The source of the error has been traced to useStyleConfig in Chakra's @chakra-ui/system:
export const Button = forwardRef<ButtonProps, 'button'>((props, ref) => {
const group = useButtonGroup()
const styles = useStyleConfig('Button', { ...group, ...props })
// ....
}export const Button = forwardRef<ButtonProps, 'button'>((props, ref) => {
const group = useButtonGroup()
const styleProps = omit(props, ['rightIcon', 'leftIcon'])
const styles = useStyleConfig('Button', { ...group, ...styleProps })
// ....
}