Open MisterJimson opened 3 months ago
Hi!
Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.
If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.
Thanks for using Clerk!
Hello 👋
In an effort to keep our GitHub issues clean and focused, we close any issues that are awaiting a reproduction after 8 days on inactivity, and it has been 7 days. This issue will be closed tomorrow unless a reproduction is provided. If it takes longer than this to get a reproduction, that's ok, just drop a comment and we will remove the Stale label.
How to create a minimal reproduction
Thanks for being a part of the Clerk community! 🙏
I have this exact same setup and am running into this issue when I try to log in with a domain that hasn't been whitelisted. It also causes a Lambda timeout which breaks my application. I have to go to a different browser and sign in, and then sign out to create a temporary fix.
For context I'm authenticating like this:
await signIn.authenticateWithRedirect({
strategy: "oauth_google",
redirectUrl: "/sso-callback",
redirectUrlComplete: "/manage-inspections",
})
FYI https://github.com/clerk/javascript/pull/3773 did not resolve the issue, I was hoping it would as some of the error message stack is the same.
Error: Clerk: auth() was called but Clerk can't detect usage of clerkMiddleware() (or the deprecated authMiddleware()). Please ensure the following: - clerkMiddleware() (or the deprecated authMiddleware()) is used in your Next.js Middleware. - Your Middleware matcher is configured to match this route or page. - If you are using the src directory, make sure the Middleware file is inside of it. For more details, see https://clerk.com/docs/quickstarts/nextjs at /var/task/packages/dashboard/.next/server/chunks/91.js:76:33305 at /var/task/packages/dashboard/.next/server/chunks/91.js:100:5877 at v (/var/task/packages/dashboard/.next/server/chunks/91.js:76:33871) at eI (/var/task/packages/dashboard/.next/server/chunks/611.js:25:37770) at Object.c [as getAlternativeEnvironmentStates] (/var/task/packages/dashboard/.next/server/chunks/51.js:1:17150) at c (/var/task/packages/dashboard/.next/server/chunks/51.js:1:18807) at eh (/var/task/node_modules/.pnpm/next@14.2.5_@opentelemetry+api@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134786) at e (/var/task/node_modules/.pnpm/next@14.2.5_@opentelemetry+api@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:137671) at ek (/var/task/node_modules/.pnpm/next@14.2.5_@opentelemetry+api@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:138145) at Object.toJSON (/var/task/node_modules/.pnpm/next@14.2.5_@opentelemetry+api@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135755)
@MisterJimson @thadhutch Would you mind checking if this snapshot fixes your issue ?
npm i @clerk/nextjs@5.3.1-snapshot.v5a90f37 --save-exact
@panteliselef that build does seem to fix the error, thank you.
As a side note, where I used to see this error, I now see a 404 due to https://github.com/clerk/javascript/issues/3864
Great, this will be shipped in the next minor/patch release.
About the 404, we will investigate. Please provide us with any additional info, that you think will help us reproduce, in #3864
Figured I'd circle back on this since it's still ongoing. For me, the issue was actually caused by how I configured my VPC. It was actually unrelated to Clerk, but I didn't reproduce once I fixed my configuration. I ended up just implementing auth with an open source library.
This issue started happening again when I updated from the snapshot build to try to get the benefit of https://github.com/clerk/javascript/issues/3864 being solved.
On "@clerk/nextjs": "5.4.0"
Preliminary Checks
[X] I have reviewed the documentation: https://clerk.com/docs
[X] I have searched for existing issues: https://github.com/clerk/javascript/issues
[X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
[X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
don't have a reproduction
Publishable key
pk_live_Y2xlcmsud2l0aHRlcm1pbmFsLmNvbSQ
Description
Steps to reproduce:
Expected behavior: You see your login page
Actual behavior:
Routing failed. TypeError: Cannot read properties of undefined (reading 'pagePath') at du (file:///var/task/packages/dashboard/middleware.mjs:56:3273) at uu (file:///var/task/packages/dashboard/middleware.mjs:56:3128) at cu (file:///var/task/packages/dashboard/middleware.mjs:56:3063) at file:///var/task/packages/dashboard/middleware.mjs:56:2570 at Object.protect (file:///var/task/packages/dashboard/middleware.mjs:56:6831) at pu.afterSignInUrl (file:///var/task/packages/dashboard/middleware.mjs:56:7570) at file:///var/task/packages/dashboard/middleware.mjs:56:4648 at AsyncLocalStorage.run (node:async_hooks:338:14) at Object.g (file:///var/task/packages/dashboard/middleware.mjs:56:4630) at async file:///var/task/packages/dashboard/middleware.mjs:23:9303
The above error is thrown by the Clerk SDK, triggering the project's Error Boundary.
My middleware file is quite simple.
Environment