Closed magnusrodseth closed 1 year ago
hello @magnusrodseth
Could you provide a repository to try and reproduce this case? The undici
is not a first level dependency of the @clerk/nextjs
but it's a dependency of the miniflare
devDependency of @clerk/backend
which is being used by @clerk/nextjs
.
Have you tried checking the stack trace of :
process.on('unhandledRejection', error => {
console.error(error);
});
I believe that using a production build would not raise this error since that dependency is not being used. But you won't be able to use the development goodies that NexJS provides (HMR, ...).
This makes a lot of sense, as I have not been able to reproduce the error in production. I'll see if I can get a reproducible repository up and running.
I'm encountering this issue in my next+trpc+clerk app as well. Happens in dev but not in production.
@mrtns Good to know that it's not just me. Would you be able to add a reproducible repository?
It might be hard to systematically repro given that it's so intermittent for me. One thing I did change this morning though was upgrading from node 16 (v16.20.0
) to 18 (v18.16.0
). It might be too early to call, but so far I haven't seen the error since.
having the same issue
error - unhandledRejection: TypeError: Cannot read properties of undefined (reading 'timeoutType')
at _resume (evalmachine.<anonymous>:11000:33)
at resume (evalmachine.<anonymous>:10969:7)
at connect (evalmachine.<anonymous>:10956:7)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
To set the stage, I am using a Turborepo with Next.js, tRPC and Clerk for authentication and user management.
As a preface: I started by asking in the Discussion in the tRPC repository, and the answer I got there was the following:
I have now setup 2 Next.js repositories which both have only Clerk in common, and the error still occurs. Hence, this leads me to believe the error I get stems from Clerk.
Ever since the start of my project, I sometimes get this error message:
The error happens sporadically, and I have not been able to pinpoint any pattern of it occurring. The thing that baffles me is that when I Google this error, no other discussions around it exist.
It may happen when fetching data asynchronously between the tRPC client and server, with the Clerk context in between.
The stack trace is also very challenging to navigate, and does not offer much help. I have now concluded that
timeoutType
is something related toundici
.Do you have any general recommendations on how to debug and fix this issue? Do you have an idea under what circumstances this can be triggered?