Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Runtime Error #13

Open
anas-aqeel opened this issue Oct 29, 2022 · 3 comments
Open

Unhandled Runtime Error #13

anas-aqeel opened this issue Oct 29, 2022 · 3 comments

Comments

@anas-aqeel
Copy link

I am facing this error

image
When I am fetching data from API in page.TSX (server component) and then pass it as a prop to my client component.

Here is my code:

Page.tsx

image

Button.tsx:

image

@azizijunaid
Copy link

i think u need to return and element with content <>Something</> or
result could be undefined or null you need to check first either it is given data from api or not.

@ahmad-an
Copy link

ahmad-an commented Jun 2, 2023

I think you are getting an object in {result} which can not be rendered. In my point of view, you should try like this {result.name} (object and key ).

@syedshahmirsultan
Copy link

Anas, please update the first line of your page.tsx code to this:
import Button from '../components/Button/Button';

The problem is in the first line, where you're trying to import the Button component from the wrong place. First, make sure that your Button component is saved in a file named either Button.tsx or button.tsx.

You mentioned the filename as Button.tsx, but in the first line of your page.tsx file, you're trying to import the Button component from ../components/button/Button, which is incorrect. Please fix the import path like I showed above, and your code will work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants