Next.js Discord

Discord Forum

Cant read DB_URL on createKysely on NextJS13 on client component

Answered
Giant Angora posted this in #help-forum
Open in Discord
Giant AngoraOP
Hello. I was able to create a form to register successfully using a tutorial from this https://codevoweb.com/learn-nextjs-server-actions-and-mutations-with-examples/. But I couldn't figure out how to show error messages from the server. so I followed this to convert the form to client: https://github.com/wpcodevo/nextjs-server-action-app/blob/main/src/components/TodoFormClientComponent.tsx. But once I did that, the createKysely can no longer find the database connection string.

Would appreciate some help. TY
Answered by Giant Angora
i got it working. i had to create a middle function called action.ts . cant just directly call a function
View full answer

1 Reply

Giant AngoraOP
i got it working. i had to create a middle function called action.ts . cant just directly call a function
Answer