Skip to content

Commit 1c3da4a

Browse files
committed
disable gssp and gsp
1 parent d93041a commit 1c3da4a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/next/build/webpack/loaders/next-flight-client-loader/module-proxy.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const MODULE_REFERENCE = Symbol.for('react.module.reference')
1111
const PROMISE_PROTOTYPE = Promise.prototype
1212

1313
const proxyHandlers: ProxyHandler<object> = {
14-
get: function (target: any, name: string, receiver: any) {
14+
get: function (target: any, name: string, _receiver: any) {
1515
switch (name) {
1616
// These names are read by the Flight runtime if you end up using the exports object.
1717
case '$$typeof':
@@ -47,7 +47,7 @@ const proxyHandlers: ProxyHandler<object> = {
4747
// the client.
4848
const then = function then(
4949
resolve: (res: any) => void,
50-
reject: (err: any) => void
50+
_reject: (err: any) => void
5151
) {
5252
const moduleReference: Record<string, any> = {
5353
$$typeof: MODULE_REFERENCE,
@@ -67,6 +67,13 @@ const proxyHandlers: ProxyHandler<object> = {
6767
// This will break if it's minified though.
6868
return then
6969
}
70+
case 'getStaticProps':
71+
return undefined
72+
case 'getServerSideProps':
73+
return undefined
74+
75+
default:
76+
break
7077
}
7178
let cachedReference = target[name]
7279
if (!cachedReference) {
@@ -79,7 +86,7 @@ const proxyHandlers: ProxyHandler<object> = {
7986
}
8087
return cachedReference
8188
},
82-
getPrototypeOf(target: object) {
89+
getPrototypeOf(_target: object) {
8390
// Pretend to be a Promise in case anyone asks.
8491
return PROMISE_PROTOTYPE
8592
},

0 commit comments

Comments
 (0)