Skip to content

Reasoning component crashes next build command #123

@Andrew-Chen-Wang

Description

@Andrew-Chen-Wang

When running next build, you'll get an error due to isOpen variable being boolean | undefined

const [isOpen, setIsOpen] = useControllableState({
      prop: open,
      defaultProp: defaultOpen,
      onChange: onOpenChange,
    })

Same goes for the duration variable as well.

You can see this issue is due to the underlying radix library. See this issue (that is still open in radix) radix-ui/primitives#2791

It affects this line

<ReasoningContext.Provider value={{ isStreaming, isOpen, setIsOpen, duration }}>

and then crashes nextjs in production build

It also says that useControllableState is not intended for public usage, so I feel like we should change this to react primitives.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions