Skip to content

Commit

Permalink
Revert "fix: Promise.prototype.finally is object (#16620)" (#16753)
Browse files Browse the repository at this point in the history
This reverts commit 6926ab7.
  • Loading branch information
ijjk authored Sep 1, 2020
1 parent f921b4f commit 91a50d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/next/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import PageLoader, { looseToArray, StyleSheetTuple } from './page-loader'
import measureWebVitals from './performance-relayer'
import { createRouter, makePublicRouterInstance } from './router'

require('next/dist/build/polyfills/finally-polyfill.min')

/// <reference types="react-dom/experimental" />

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

if (!('finally' in Promise.prototype)) {
;(Promise.prototype as PromiseConstructor['prototype']).finally = require('next/dist/build/polyfills/finally-polyfill.min')
}

const data: typeof window['__NEXT_DATA__'] = JSON.parse(
document.getElementById('__NEXT_DATA__')!.textContent!
)
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"escape-string-regexp": "2.0.0",
"etag": "1.8.1",
"file-loader": "6.0.0",
"finally-polyfill": "0.2.0",
"finally-polyfill": "0.1.0",
"find-up": "4.1.0",
"fresh": "0.5.2",
"gzip-size": "5.1.1",
Expand Down

0 comments on commit 91a50d3

Please sign in to comment.