From 0b9cec9c44e769344d6fd64b59db8f0a9e39e504 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 2 Nov 2023 16:50:05 -0700 Subject: [PATCH] Fix some Typescript errors when using latest Next Ran into these when building for deploy! --- pages/_app.tsx | 19 ++++++++++--------- tsconfig.json | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index 9a3761b..91a96d6 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -19,7 +19,7 @@ export type NextPageWithLayout

= NextPage & { const theme = extendTheme({ styles: { - global: (props) => ({ + global: (props: any) => ({ html: { // HACK: Chakra sets body as the relative position element, which is // fine, except its `min-height: 100%` doesn't actually work @@ -35,7 +35,10 @@ const theme = extendTheme({ }, }); -type AppPropsWithLayout = AppProps & { Component: NextPageWithLayout }; +type AppPropsWithLayout = AppProps & { + Component: NextPageWithLayout; + pageProps: any; +}; export default function DTIApp({ Component, pageProps }: AppPropsWithLayout) { const renderWithLayout = @@ -92,9 +95,8 @@ function DTIApolloProvider({ // Save the first `additionalCacheState` we get as our `initialCacheState`, // which we'll use to initialize the client without having to wait a tick. - const [initialCacheState, unusedSetInitialCacheState] = React.useState( - additionalCacheState - ); + const [initialCacheState, unusedSetInitialCacheState] = + React.useState(additionalCacheState); const client = React.useMemo( () => @@ -102,7 +104,7 @@ function DTIApolloProvider({ getAuth0: () => auth0Ref.current, initialCacheState, }), - [initialCacheState] + [initialCacheState], ); // When we get a new `additionalCacheState` object, merge it into the cache: @@ -135,7 +137,7 @@ function DTIApolloProvider({ console.debug( "Merging Apollo cache:", additionalCacheState, - mergedCacheState + mergedCacheState, ); client.cache.restore(mergedCacheState); }, [client, additionalCacheState]); @@ -145,8 +147,7 @@ function DTIApolloProvider({ function setupLogging() { Sentry.init({ - dsn: - "https://c55875c3b0904264a1a99e5b741a221e@o506079.ingest.sentry.io/5595379", + dsn: "https://c55875c3b0904264a1a99e5b741a221e@o506079.ingest.sentry.io/5595379", autoSessionTracking: true, integrations: [ new Integrations.BrowserTracing({ diff --git a/tsconfig.json b/tsconfig.json index 5b5c47c..e399e71 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "lib": ["dom", "dom.iterable", "esnext"], + "lib": ["dom", "dom.iterable", "es2021"], "allowJs": true, "allowSyntheticDefaultImports": true, "noFallthroughCasesInSwitch": true,