diff --git a/pages/_app.tsx b/pages/_app.tsx index 59f4788e3cc..8c66b27a186 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -27,6 +27,23 @@ import "../src/global-css"; import "../src/test-prep"; import "../src/base.css"; +if (typeof window !== "undefined") { + // @ts-expect-error + Promise.prototype.finally = function (callback) { + debugger; + this.then( + result => { + callback && callback(); + return result; + }, + result => { + callback && callback(); + throw result; + } + ); + }; +} + interface AuthProps { apiKey?: string; } diff --git a/pages/_document.tsx b/pages/_document.tsx index a184504447b..f8a6bc1ca0b 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,7 +1,6 @@ import crypto from "crypto"; import * as Sentry from "@sentry/browser"; import Document, { Head, Html, Main, NextScript } from "next/document"; -import Script from "next/script"; import React from "react"; import { setErrorHandler } from "protocol/utils"; @@ -65,25 +64,6 @@ export default class MyDocument extends Document { -