diff --git a/apps/web/app/_types.ts b/apps/web/app/_types.ts index 30a4ce6579..8f73517ba8 100644 --- a/apps/web/app/_types.ts +++ b/apps/web/app/_types.ts @@ -13,5 +13,5 @@ export type PageProps = { export type LayoutProps = { params: Promise; children: React.ReactElement }; -export { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers"; -export { type ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies"; +export type ReadonlyHeaders = Awaited>; +export type ReadonlyRequestCookies = Awaited>; diff --git a/apps/web/lib/buildLegacyCtx.tsx b/apps/web/lib/buildLegacyCtx.tsx index f26f8a4e09..614393584c 100644 --- a/apps/web/lib/buildLegacyCtx.tsx +++ b/apps/web/lib/buildLegacyCtx.tsx @@ -1,8 +1,7 @@ import type { SearchParams } from "app/_types"; import { type Params } from "app/_types"; +import type { ReadonlyHeaders, ReadonlyRequestCookies } from "app/_types"; import type { GetServerSidePropsContext, NextApiRequest } from "next"; -import { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers"; -import { type ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies"; const createProxifiedObject = (object: Record) => new Proxy(object, { diff --git a/apps/web/pages/_app.tsx b/apps/web/pages/_app.tsx index 5ae26bac6a..8b34a72e09 100644 --- a/apps/web/pages/_app.tsx +++ b/apps/web/pages/_app.tsx @@ -1,6 +1,6 @@ import type { IncomingMessage } from "http"; +import type { NextPageContext } from "next"; import { SessionProvider } from "next-auth/react"; -import type { AppContextType } from "next/dist/shared/lib/utils"; import React from "react"; import CacheProvider from "react-inlinesvg/provider"; @@ -32,8 +32,8 @@ declare global { } } -MyApp.getInitialProps = async (ctx: AppContextType) => { - const { req } = ctx.ctx; +MyApp.getInitialProps = async ({ ctx }: { ctx: NextPageContext }) => { + const { req } = ctx; let newLocale = "en"; diff --git a/packages/features/auth/lib/getLocale.ts b/packages/features/auth/lib/getLocale.ts index 1df0780a11..4f5bbe9cec 100644 --- a/packages/features/auth/lib/getLocale.ts +++ b/packages/features/auth/lib/getLocale.ts @@ -2,11 +2,12 @@ import { parse } from "accept-language-parser"; import { lookup } from "bcp-47-match"; import type { GetTokenParams } from "next-auth/jwt"; import { getToken } from "next-auth/jwt"; -import { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers"; -import { type ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies"; import { i18n } from "@calcom/config/next-i18next.config"; +type ReadonlyHeaders = Awaited>; +type ReadonlyRequestCookies = Awaited>; + /** * This is a slimmed down version of the `getServerSession` function from * `next-auth`.