Why is this error only happening on the deployed app?
Unanswered
Sussex Spaniel posted this in #help-forum
Sussex SpanielOP
"Error: NEXT_REDIRECT at u (/var/www/randomwebsite/clientside/.next/server/chunks/5945.js:1:9042) at l (/var/www/randomwebsite/clientside/.next/server/chunks/5945.js:1:9257) at r (/var/www/randomwebsite/clientside/.next/server/chunks/651.js:1:46994) at s (/var/www/randomwebsite/clientside/.next/server/chunks/651.js:1:47127) at f (/var/www/randomwebsite/clientside/.next/server/app/api/notification/count/route.js:1:1113) at /var/www/randomwebsite/clientside/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:42490 at /var/www/randomwebsite/clientside/node_modules/next/dist/server/lib/trace/tracer.js:133:36 at NoopContextManager.with (/var/www/randomwebsite/clientside/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js:25:19) at ContextAPI.with (/var/www/randomwebsite/clientside/node_modules/@opentelemetry/api/build/src/api/context.js:60:46) at NoopTracer.startActiveSpan (/var/www/randomwebsite/clientside/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js:65:31)",4 Replies
Sussex SpanielOP
Happens specifically at this page.tsx, breaking on redirect.
const session = getSession();
if (session === undefined) {
return redirect("/");
}
const {
profile: { userId },
} = session as unknown as Session;
if (userId === undefined) {
return redirect("/");
}
const foundWorkspaces = await getAllWorkspaces(userId ?? "");
const defaultMyWorkspace = foundWorkspaces
.toSorted((workspaceOne, workspaceTwo) => {
const workspaceOneDate =
workspaceOne.created_at ?? new Date(Date.now());
const workspaceTwoDate =
workspaceTwo.created_at ?? new Date(Date.now());
return workspaceOneDate.getTime() - workspaceTwoDate.getTime();
})
.find(
(eachWorkspace) =>
eachWorkspace.workspace_type === WorkSpaceType.MY,
);
if (defaultMyWorkspace === undefined) {
return redirect("/");
}
const foundTasks = await getTasksSearch(
0,
"",
defaultMyWorkspace.id ?? 0,
ToggleSelected.ALL,
"",
);
const workspaceInfo = await getWorkspaceInformation(
defaultMyWorkspace.id ?? 0,
);
return (
<ViewWorkspace
defaultWorkspaceId={defaultMyWorkspace.id}
initialTotalPageCount={foundTasks.totalPageCount}
userId={userId ?? ""}
workspaceId={defaultMyWorkspace.id ?? 0}
workspaceInfo={workspaceInfo as WorkspaceInfo}
/>
);I'm just confused why it's working locally just fine, but failing on the deployed app.
Works on vercel deployment but not on custom domain deployment 🙃 probably something just going on with the custom domain deployment.
I'll try a few things and report back