You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the Card Component of react-bootstrap as it is intended in the docs. Here is my React component:
TourSelector.tsx
"use server";import{getTours}from"@/utils/data";importCardfrom"react-bootstrap/Card";// import CardBody from "react-bootstrap/CardBody";// import CardTitle from "react-bootstrap/CardTitle";exportdefaultasyncfunctionTourSelector(){consttours=awaitgetTours();return(<divclassName="d-flex gap-2">{tours.map((tour)=><Cardkey={tour.id}style={{width: "18rem"}}><Card.Body><Card.Title>{tour.name}</Card.Title></Card.Body></Card>)}</div>)}
However, on the site where this is used I get the Next.js error of Error: Unsupported Server Component type: undefined and the cmd output on the dev server says
Check your code at TourSelector.tsx:14.
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
When I don't use Card.Body and Card.Title (so only Card) it works fine.
What am I doing wrong?
Expected behavior
No response
To Reproduce
Use this server component in your app on Next.js (App Router)
Provide data (in my case just some sample async data with a delay, mimicking a local DB)
Run
Reproducible Example
Only tested on Next.js
Screenshots
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of React-Bootstrap are you using?
2.9.1
What version of Bootstrap are you using?
5.3.2
Additional context
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Describe the bug
I am trying to use the Card Component of react-bootstrap as it is intended in the docs. Here is my React component:
TourSelector.tsx
However, on the site where this is used I get the Next.js error of
Error: Unsupported Server Component type: undefined
and the cmd output on the dev server saysWhen I don't use
Card.Body
andCard.Title
(so onlyCard
) it works fine.What am I doing wrong?
Expected behavior
No response
To Reproduce
Reproducible Example
Only tested on Next.js
Screenshots
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of React-Bootstrap are you using?
2.9.1
What version of Bootstrap are you using?
5.3.2
Additional context
No response
The text was updated successfully, but these errors were encountered: