Todo App tutorial doesn't work #2829
Unanswered
nareshbhatia
asked this question in
Q&A
Replies: 1 comment
-
I would be happy to create a PR, if someone can confirm that this is indeed an issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just starting out with drizzle. Todo App tutorial doesn't work. When the home page comes up, it does not show existing TODOs in the database. This also messes up insert functionality, because insert relies on the count of existing todos to add the next one.
Turns out that the root cause of this issue is a quirk in Next.js. By default, it tries to compile the home page as a static page. So the get query goes to the database at build time and for some reason that is not returning any records. In any case, an application that is dependent on dynamic data should not be rendered at build time anyway. The fix is to convert the page to a dynamically rendered page. Here's how I fixed it:
Has anyone experience this issue?
Beta Was this translation helpful? Give feedback.
All reactions