nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
21.63k stars 1.42k forks source link

Use Table in Astro, "type.getCollectionNode is not a function" error #1766

Closed chengluliu closed 4 weeks ago

chengluliu commented 11 months ago

NextUI Version

2.0.13

Describe the bug

Used in Astro using Table, "type.getCollectionNode is not a function" error

include

.....

has children elements

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

--- import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react"; ---

<Table aria-label='Example static collection table' className='mt-5' client:visible={true}>
      <TableHeader>
        <TableColumn >NAME</TableColumn>
        <TableColumn>ROLE</TableColumn>
        <TableColumn>STATUS</TableColumn>
      </TableHeader>
      <TableBody>
        <TableRow key='1'>
          <TableCell>Tony Reichert</TableCell>
          <TableCell>CEO</TableCell>
          <TableCell>Active</TableCell>
        </TableRow>
      </TableBody>
    </Table>

Expected behavior

I hope it will work properly

Screenshots or Videos

no

Operating System Version

macOS

Browser

Edge

akomm commented 10 months ago

Could be this problem (includes evtl. workaround): https://github.com/nextui-org/nextui/issues/1958#issuecomment-1832035732 The problem is evtl. the key not properly handled in .astra file. Try wrap the whole table in a component and instead use the one component in .astra file.

chengluliu commented 6 months ago

Could be this problem (includes evtl. workaround): #1958 (comment) The problem is evtl. the key not properly handled in .astra file. Try wrap the whole table in a component and instead use the one component in .astra file.

Yes, I did with react component wrappers