next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

chapter 7 - charts not displaying -> console errors

Open tomas99batista opened this issue 1 year ago • 7 comments

image

backend.bundle.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'current') at backend.bundle.js:1:128442 at backend.bundle.js:1:128598 at backend.bundle.js:1:127404 at Object.next (backend.bundle.js:1:127509) at backend.bundle.js:1:126424 at new Promise (<anonymous>) at C (backend.bundle.js:1:126169) at backend.bundle.js:1:128313 at o (backend.bundle.js:1:128122)

tomas99batista avatar Nov 04 '23 21:11 tomas99batista

could it be a version problem?

tomas99batista avatar Nov 04 '23 21:11 tomas99batista

Hi @tomas99batista, thanks for the feedback! This can be due to a couple of things. First, make sure all of your environment variables were copied over correctly. You should have the following in your .env file:

POSTGRES_URL=
POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
POSTGRES_USER=
POSTGRES_HOST=
POSTGRES_PASSWORD=
POSTGRES_DATABASE=

Next, ensure that you successfully seeded data into your tables in the previous step. Check out this section if you need help exploring your database. Finally, make sure the code in your RevenueChart component (/app/ui/dashboard/revenue-chart) has been uncommented. I have a PR updating the course to make this more clear.

Let me know if the issue persists after trying these and I will look more into it :)

StephDietz avatar Nov 13 '23 14:11 StephDietz

@tomas99batista ensure that step 6 is correctly finished.

DemaPy avatar Nov 15 '23 20:11 DemaPy

Hey @tomas99batista, any luck? Were you able to fix the error above?

delbaoliveira avatar Nov 20 '23 10:11 delbaoliveira

Hi @delbaoliveira and @StephDietz Thank you for this post. I'm also having trouble displaying the charts on the dashboard page. Is still no chart and I think I did it correctly. I tried to comment, uncomment again, seeding was successful.

Not sure how I can fix this. If you can help it would be really amazing.

PS- So far the tutorial is amazing and very well explained. Kudos @delbaoliveira Screenshot 2023-12-04 at 15 30 42 Screenshot 2023-12-04 at 15 31 03 Screenshot 2023-12-04 at 15 33 39

Tuminha avatar Dec 04 '23 14:12 Tuminha

I do get a typescript issue in app/dashboard/page.tsx about the component <RevenueChart revenue={revenue} />

Screenshot 2024-01-13 at 9 00 49 PM

if you get this issue, you need to remove async from RevenueChart

tiuscia avatar Jan 13 '24 21:01 tiuscia

actually in chapter 9, we do need to add async to the to components. so the only solution I found was using {/* @ts-expect-error Server Component */} is this the only solution correct?

@delbaoliveira

tiuscia avatar Jan 14 '24 20:01 tiuscia

Closing this one as stale, but please open a new issue if you are still having trouble here. Thank you!

leerob avatar Jun 23 '24 22:06 leerob