onAfterLogin hook crashing the server

I'm trying to implement the v0.14.1 onAfterLogin hooks but after logging in with email it loads for like 20seconds and after gives error to the console. This error is logged out hundreds of times
[ Server!] This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
[ Server!] Please open an issue with this stack trace at https://github.com/nodejs/node/issues
[ Server!]
[ Server!] at Function.fail (node:internal/assert:20:9)
[ Server!] at handleMaxCallStackSize (node:internal/util/inspect:1556:10)
[ Server!] at formatRaw (node:internal/util/inspect:1062:12)
[ Server!] at formatValue (node:internal/util/inspect:840:10)
[ Server!] at formatProperty (node:internal/util/inspect:1945:11)
[ Server!] at formatRaw (node:internal/util/inspect:1054:9)
[ Server!] at formatValue (node:internal/util/inspect:840:10)
[ Server!] at inspect (node:internal/util/inspect:364:10)
[ Server!] at Ne.i.<computed> (/..../SC-app/app/node_modules/@prisma/client/runtime/library.js:31:8652)
[ Server!] at formatValue (node:internal/util/inspect:805:19)
[ Server!] This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
[ Server!] Please open an issue with this stack trace at https://github.com/nodejs/node/issues
[ Server!]
[ Server!] at Function.fail (node:internal/assert:20:9)
[ Server!] at handleMaxCallStackSize (node:internal/util/inspect:1556:10)
[ Server!] at formatRaw (node:internal/util/inspect:1062:12)
[ Server!] at formatValue (node:internal/util/inspect:840:10)
[ Server!] at formatProperty (node:internal/util/inspect:1945:11)
[ Server!] at formatRaw (node:internal/util/inspect:1054:9)
[ Server!] at formatValue (node:internal/util/inspect:840:10)
[ Server!] at inspect (node:internal/util/inspect:364:10)
[ Server!] at Ne.i.<computed> (/..../SC-app/app/node_modules/@prisma/client/runtime/library.js:31:8652)
[ Server!] at formatValue (node:internal/util/inspect:805:19)
Everything other works fine but logging in halts the server Created this in hooks.ts
export const onAfterLogin: OnAfterLoginHook = async ({ user, prisma }) => {
console.log({ user });
};
export const onAfterLogin: OnAfterLoginHook = async ({ user, prisma }) => {
console.log({ user });
};
I've also tried v0.14.2 version, doing wasp clean but nothing. using node v20.14.0 How could I fix this issue?
2 Replies
kapa.ai
kapa.ai2mo ago
Hi @Marten T.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not contain specific information about the onAfterLogin hook causing server crashes in Wasp. However, based on the error message you provided, it seems like there might be an issue with Node.js or its usage. It's also possible that the issue is related to the Prisma client, as it's mentioned in the error stack trace. In the meantime, you might find it helpful to check the Wasp GitHub issues (https://github.com/wasp-lang/wasp/issues) for similar problems or the Wasp documentation (https://wasp-lang.dev/docs) for more information on how to use hooks. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Marten T., I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
miho
miho2mo ago
Could you share a bit of your Wasp file where you set up the hook and the full hook code?
Want results from more Discord servers?
Add your server