next-learn
next-learn copied to clipboard
chapter 7 - charts not displaying -> console errors
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)
could it be a version problem?
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 :)
@tomas99batista ensure that step 6 is correctly finished.
Hey @tomas99batista, any luck? Were you able to fix the error above?
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
I do get a typescript issue in app/dashboard/page.tsx about the component <RevenueChart revenue={revenue} />
if you get this issue, you need to remove async from RevenueChart
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
Closing this one as stale, but please open a new issue if you are still having trouble here. Thank you!