You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
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
Will create if needed
Publishable key
Will add if needed
Description
I'm upgrading to v6 and cannot use the provided error handlers:
⨯ TypeError: (0 , clerk_nextjs_errors__WEBPACK_IMPORTED_MODULE_4_.isClerkAPIResponseError) is not a function
[07:09:06.220] ERROR (api-error-handler/26689): API Error occurred
error: {
"status": 400,
"clerkTraceId": "0128e81e3b5242bd15a9da2e54cf54eb",
"clerkError": true,
"errors": [
{
"code": "organization_minimum_permissions_needed",
"message": "minimum organization permissions needed",
"longMessage": "There has to be at least one organization member with the minimum required permissions",
"meta": {}
}
]
}
Instead of isClerkAPIResponseError executing, I get an import failure. Full stack trace:
⨯ TypeError: (0 , _clerk_nextjs_errors__WEBPACK_IMPORTED_MODULE_4__.isClerkAPIResponseError) is not a function
at eval (webpack-internal:///(rsc)/./app/api/api-error-handler.tsx:48:94)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@sentry+nextjs@8.38.0_@opentelemetry+core@1.27.0_@opentelemetry+api@1.9.0__@opentelemetry+ins_pukndwabmym6vqunvov2jrcvsm/node_modules/@sentry/nextjs/build/cjs/common/wrapRouteHandlerWithSentry.js:40:30)
at async /home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:55831
at async eO.execute (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:46527)
at async eO.handle (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:57165)
at async doRender (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1353:42)
at async cacheEntry.responseCache.get.routeKind (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1575:28)
at async DevServer.renderToResponseWithComponentsImpl (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1483:28)
at async DevServer.renderPageComponent (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1911:24)
at async DevServer.renderToResponseImpl (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:1949:32)
at async DevServer.pipeImpl (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:921:25)
at async NextNodeServer.handleCatchallRenderRequest (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/next-server.js:272:17)
at async DevServer.handleRequestImpl (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/base-server.js:817:17)
at async /home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:339:20
at async Span.traceAsyncFn (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/trace/trace.js:154:20)
at async DevServer.handleRequest (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/dev/next-dev-server.js:336:24)
at async invokeRender (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:173:21)
at async handleRequest (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:350:24)
at async requestHandlerImpl (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/router-server.js:374:13)
at async Server.requestListener (/home/lmyslinski/Dev/cv2b/cv2b/web/node_modules/.pnpm/next@14.2.18_@babel+core@7.26.0_@opentelemetry+api@1.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/server/lib/start-server.js:141:13)
DELETE /api/organization/membership?orgId=org_2oxqsB3fT0xf6VMfn5rX413Ye7K 500 in 1258ms
[07:09:06.220] ERROR (api-error-handler/26689): API Error occurred
error: {
"status": 400,
"clerkTraceId": "0128e81e3b5242bd15a9da2e54cf54eb",
"clerkError": true,
"errors": [
{
"code": "organization_minimum_permissions_needed",
"message": "minimum organization permissions needed",
"longMessage": "There has to be at least one organization member with the minimum required permissions",
"meta": {}
}
]
}
Hey @lmyslinski thanks for discovering this bug. If you were to upgrade to next 15 the error message would change to describe the issue better. Ultimately the issue is that we re-export the isClerkAPIResponseError under a "use-client" barrier which makes is non existent in your server-only bundle for Route handlers.
We will be fixing this soon, but as a workaround please import the utility from '@clerk/shared/error' (you might need to install the package explicitly).
A follow-up question I have is, from which @clerk/nextjs are you upgrading from, since this bug seems to existed since v5.
However I haven't used this method before, decide to improve the error handling along with the upgrade. As a workaround I've just implemented a similar method myself so I'm good for now.
Preliminary Checks
I have reviewed the documentation: https://clerk.com/docs
I have searched for existing issues: https://github.com/clerk/javascript/issues
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
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
Will create if needed
Publishable key
Will add if needed
Description
I'm upgrading to v6 and cannot use the provided error handlers:
⨯ TypeError: (0 , clerk_nextjs_errors__WEBPACK_IMPORTED_MODULE_4_.isClerkAPIResponseError) is not a function
Route that throws the error:
Actual error from logs:
Instead of
isClerkAPIResponseError
executing, I get an import failure. Full stack trace:Environment
The text was updated successfully, but these errors were encountered: