Skip to content

Commit 91a50d3

Browse files
authoredSep 1, 2020
Revert "fix: Promise.prototype.finally is object (#16620)" (#16753)
This reverts commit 6926ab7.
1 parent f921b4f commit 91a50d3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎packages/next/client/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import PageLoader, { looseToArray, StyleSheetTuple } from './page-loader'
2121
import measureWebVitals from './performance-relayer'
2222
import { createRouter, makePublicRouterInstance } from './router'
2323

24-
require('next/dist/build/polyfills/finally-polyfill.min')
25-
2624
/// <reference types="react-dom/experimental" />
2725

2826
declare let __webpack_public_path__: string
@@ -43,6 +41,10 @@ declare global {
4341
type RenderRouteInfo = PrivateRouteInfo & { App: AppComponent }
4442
type RenderErrorProps = Omit<RenderRouteInfo, 'Component' | 'styleSheets'>
4543

44+
if (!('finally' in Promise.prototype)) {
45+
;(Promise.prototype as PromiseConstructor['prototype']).finally = require('next/dist/build/polyfills/finally-polyfill.min')
46+
}
47+
4648
const data: typeof window['__NEXT_DATA__'] = JSON.parse(
4749
document.getElementById('__NEXT_DATA__')!.textContent!
4850
)

‎packages/next/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
"escape-string-regexp": "2.0.0",
182182
"etag": "1.8.1",
183183
"file-loader": "6.0.0",
184-
"finally-polyfill": "0.2.0",
184+
"finally-polyfill": "0.1.0",
185185
"find-up": "4.1.0",
186186
"fresh": "0.5.2",
187187
"gzip-size": "5.1.1",

0 commit comments

Comments
 (0)
Please sign in to comment.