xlang-ai / OpenAgents

[COLM 2024] OpenAgents: An Open Platform for Language Agents in the Wild
https://arxiv.org/abs/2310.10634
Apache License 2.0
4.02k stars 447 forks source link

frontend build error #53

Closed du00cs closed 1 year ago

du00cs commented 1 year ago

frontend throws this error, any idea to fix it ? It seems related to react-pdf.

./components/Chat/ChatRichContentItem.tsx:200:23
Type error: No overload matches this call.
  Overload 1 of 2, '(props: Props | Readonly<Props>): Document', gave the following error.
    Type 'Element' is not assignable to type 'ReactNode'.
  Overload 2 of 2, '(props: Props, context: any): Document', gave the following error.
    Type 'Element' is not assignable to type 'ReactNode'.

  198 |                       }}
  199 |                     >
> 200 |                       <Page pageNumber={pageNumber} />
      |                       ^
  201 |                     </Document>
  202 | 
  203 |                     <div className="flex gap-2 item-center mt-3">

another case

./components/CodeModal/CodeModal.tsx:73:5
Type error: Argument of type 'Element' is not assignable to parameter of type 'ReactNode'.
  Property 'children' is missing in type 'Element' but required in type 'ReactPortal'.

  71 | 
  72 |   return createPortal(
> 73 |     <Rnd
     |     ^
  74 |       dragHandleClassName="handle"
  75 |       className="z-[9999] shadow-lg"
  76 |       default={{

maybe it's simple but I have no experience of react and typescript.

xjq284 commented 1 year ago

so do i,

BlankCheng commented 1 year ago

We have removed pdfjs dependency now. Could you pull the latest and try it again?

BlankCheng commented 1 year ago

Closed as no further discussion. Please feel free to reopen it if needed.