Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not assign to readonly property in Safari #16051

Merged
merged 2 commits into from
Aug 10, 2020
Merged

Conversation

Timer
Copy link
Member

@Timer Timer commented Aug 10, 2020

Safari now treats Error#code as a readonly property, which means we can no longer override it.
This PR replaces the now-reserved property with a Symbol descriptor.

It also adds new production tests for this behavior to ensure they're ran against all major browsers (Safari included) in our E2E CI.


Fixes #11608

Safari now treats Error#code as a readonly property, which means we can no longer override it.
This PR replaces the now-reserved property with a Symbol descriptor.

It also adds new production tests for this behavior to ensure they're ran against all major browsers (Safari included) in our E2E CI.

---

Fixes vercel#11608
@ijjk
Copy link
Member

ijjk commented Aug 10, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
buildDuration 12.6s 12.2s -368ms
nodeModulesSize 64.7 MB 64.7 MB ⚠️ +505 B
Page Load Tests Overall increase ✓
vercel/next.js canary Timer/next.js hotfix/11608 Change
/ failed reqs 0 0
/ total time (seconds) 2.216 2.176 -0.04
/ avg req/sec 1128.2 1149.03 +20.83
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.233 1.197 -0.04
/error-in-render avg req/sec 2027.49 2087.89 +60.4
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..ec1a.js gzip 9.99 kB 10 kB ⚠️ +25 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-8927408..22b2.js gzip 6.74 kB 6.72 kB -13 B
webpack-ccf5..276a.js gzip 751 B 751 B
Overall change 56.6 kB 56.6 kB ⚠️ +12 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..dule.js gzip 5.89 kB 5.92 kB ⚠️ +30 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-15cde23..dule.js gzip 5.81 kB 5.79 kB -17 B
webpack-10c7..dule.js gzip 751 B 751 B
Overall change 51.6 kB 51.6 kB ⚠️ +13 B
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/11608 Change
polyfills-75..1629.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-874bd8a..0103.js gzip 1.28 kB 1.28 kB
_error-fa39c..ec40.js gzip 3.45 kB 3.45 kB
hooks-585f07..95a3.js gzip 887 B 887 B
index-c7b63f..fc02.js gzip 227 B 227 B
link-f4d2979..e57b.js gzip 1.29 kB 1.29 kB
routerDirect..ebc7.js gzip 284 B 284 B
withRouter-2..db68.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-97e743e..dule.js gzip 626 B 626 B
_error-b4004..dule.js gzip 2.3 kB 2.3 kB
hooks-696209..dule.js gzip 387 B 387 B
index-a4dd74..dule.js gzip 226 B 226 B
link-653c74f..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-1..dule.js gzip 282 B 282 B
Overall change 5.37 kB 5.37 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/11608 Change
_buildManifest.js gzip 273 B 273 B
_buildManife..dule.js gzip 280 B 280 B
Overall change 553 B 553 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary Timer/next.js hotfix/11608 Change
index.html gzip 948 B 946 B -2 B
link.html gzip 955 B 952 B -3 B
withRouter.html gzip 942 B 940 B -2 B
Overall change 2.85 kB 2.84 kB -7 B

Diffs

Diff for 677f882d2ed8..01.module.js
@@ -537,6 +537,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.delBasePath = delBasePath;
       exports.isLocalURL = isLocalURL;
       exports.resolveHref = resolveHref;
+      exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
@@ -635,6 +636,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         }
       }
 
+      var PAGE_LOAD_ERROR = Symbol("PAGE_LOAD_ERROR");
+
+      function markLoadingError(err) {
+        return Object.defineProperty(err, PAGE_LOAD_ERROR, {});
+      }
+
       function prepareUrlAs(router, url, as) {
         // If url and as provided as an object representation,
         // we'll format them into the string version here.
@@ -690,7 +697,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // on a client-side transition. Otherwise, we'd get into an infinite
           // loop.
           if (!isServerRender) {
-            err.code = "PAGE_LOAD_ERROR";
+            markLoadingError(err);
           }
 
           throw err;
@@ -1085,7 +1092,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             throw err;
           }
 
-          if (err.code === "PAGE_LOAD_ERROR" || loadErrorFail) {
+          if (PAGE_LOAD_ERROR in err || loadErrorFail) {
             Router.events.emit("routeChangeError", err, as); // If we can't load the page it could be one of following reasons
             //  1. Page doesn't exists
             //  2. Page does exist in a different zone
Diff for 677f882d2ed8..a52e0893d.js
@@ -678,6 +678,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.delBasePath = delBasePath;
       exports.isLocalURL = isLocalURL;
       exports.resolveHref = resolveHref;
+      exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
@@ -776,6 +777,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         }
       }
 
+      var PAGE_LOAD_ERROR = Symbol("PAGE_LOAD_ERROR");
+
+      function markLoadingError(err) {
+        return Object.defineProperty(err, PAGE_LOAD_ERROR, {});
+      }
+
       function prepareUrlAs(router, url, as) {
         // If url and as provided as an object representation,
         // we'll format them into the string version here.
@@ -833,7 +840,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // on a client-side transition. Otherwise, we'd get into an infinite
           // loop.
           if (!isServerRender) {
-            err.code = "PAGE_LOAD_ERROR";
+            markLoadingError(err);
           }
 
           throw err;
@@ -1400,9 +1407,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             throw err;
 
                           case 2:
-                            if (
-                              !(err.code === "PAGE_LOAD_ERROR" || loadErrorFail)
-                            ) {
+                            if (!(PAGE_LOAD_ERROR in err || loadErrorFail)) {
                               _context2.next = 6;
                               break;
                             }
Diff for main-6a20493..23.module.js
@@ -1116,15 +1116,7 @@
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
 
-      var _isDynamic = __webpack_require__("/jkW");
-
-      var _routeMatcher = __webpack_require__("gguc");
-
-      var _routeRegex = __webpack_require__("YTqd");
-
-      var _querystring = __webpack_require__("3WeD");
-
-      var _parseRelativeUrl = __webpack_require__("hS4m");
+      var _router = __webpack_require__("elyg");
 
       var _escapePathDelimiters = _interopRequireDefault(
         __webpack_require__("fcRV")
@@ -1134,7 +1126,15 @@
         __webpack_require__("Lab5")
       );
 
-      var _router = __webpack_require__("elyg");
+      var _isDynamic = __webpack_require__("/jkW");
+
+      var _parseRelativeUrl = __webpack_require__("hS4m");
+
+      var _querystring = __webpack_require__("3WeD");
+
+      var _routeMatcher = __webpack_require__("gguc");
+
+      var _routeRegex = __webpack_require__("YTqd");
 
       function hasRel(rel, link) {
         try {
@@ -1144,9 +1144,9 @@
       }
 
       function pageLoadError(route) {
-        var error = new Error("Error loading ".concat(route));
-        error.code = "PAGE_LOAD_ERROR";
-        return error;
+        return (0, _router.markLoadingError)(
+          new Error("Error loading ".concat(route))
+        );
       }
 
       var relPrefetch =
Diff for main-eeb0502..13cbe3936.js
@@ -1477,15 +1477,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
 
-      var _isDynamic = __webpack_require__("/jkW");
-
-      var _routeMatcher = __webpack_require__("gguc");
-
-      var _routeRegex = __webpack_require__("YTqd");
-
-      var _querystring = __webpack_require__("3WeD");
-
-      var _parseRelativeUrl = __webpack_require__("hS4m");
+      var _router = __webpack_require__("elyg");
 
       var _escapePathDelimiters = _interopRequireDefault(
         __webpack_require__("fcRV")
@@ -1495,7 +1487,15 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         __webpack_require__("Lab5")
       );
 
-      var _router = __webpack_require__("elyg");
+      var _isDynamic = __webpack_require__("/jkW");
+
+      var _parseRelativeUrl = __webpack_require__("hS4m");
+
+      var _querystring = __webpack_require__("3WeD");
+
+      var _routeMatcher = __webpack_require__("gguc");
+
+      var _routeRegex = __webpack_require__("YTqd");
 
       function hasRel(rel, link) {
         try {
@@ -1505,9 +1505,9 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
       }
 
       function pageLoadError(route) {
-        var error = new Error("Error loading ".concat(route));
-        error.code = "PAGE_LOAD_ERROR";
-        return error;
+        return (0, _router.markLoadingError)(
+          new Error("Error loading ".concat(route))
+        );
       }
 
       var relPrefetch =
Diff for index.html
@@ -6,7 +6,7 @@
     <meta name="next-head-count" content="2" />
     <link
       rel="preload"
-      href="/_next/static/chunks/main-6a2049350a56eb766c23.module.js"
+      href="/_next/static/chunks/main-0c971b4b4e406f68741b.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -81,13 +81,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-eeb050234ea13cbe3936.js"
+      src="/_next/static/chunks/main-90ab0b721012dc5f9113.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-6a2049350a56eb766c23.module.js"
+      src="/_next/static/chunks/main-0c971b4b4e406f68741b.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2e522db0023a52e0893d.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -6,7 +6,7 @@
     <meta name="next-head-count" content="2" />
     <link
       rel="preload"
-      href="/_next/static/chunks/main-6a2049350a56eb766c23.module.js"
+      href="/_next/static/chunks/main-0c971b4b4e406f68741b.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -86,13 +86,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-eeb050234ea13cbe3936.js"
+      src="/_next/static/chunks/main-90ab0b721012dc5f9113.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-6a2049350a56eb766c23.module.js"
+      src="/_next/static/chunks/main-0c971b4b4e406f68741b.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2e522db0023a52e0893d.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -6,7 +6,7 @@
     <meta name="next-head-count" content="2" />
     <link
       rel="preload"
-      href="/_next/static/chunks/main-6a2049350a56eb766c23.module.js"
+      href="/_next/static/chunks/main-0c971b4b4e406f68741b.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -81,13 +81,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-eeb050234ea13cbe3936.js"
+      src="/_next/static/chunks/main-90ab0b721012dc5f9113.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-6a2049350a56eb766c23.module.js"
+      src="/_next/static/chunks/main-0c971b4b4e406f68741b.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2e522db0023a52e0893d.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
buildDuration 14.1s 14.2s ⚠️ +72ms
nodeModulesSize 64.7 MB 64.7 MB ⚠️ +505 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..ec1a.js gzip 9.99 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-8927408..22b2.js gzip 6.74 kB N/A N/A
webpack-ccf5..276a.js gzip 751 B 751 B
677f882d2ed8..6aa6.js gzip N/A 10 kB N/A
main-26a2edd..9a33.js gzip N/A 6.72 kB N/A
Overall change 56.6 kB 56.6 kB ⚠️ +12 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..dule.js gzip 5.89 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-15cde23..dule.js gzip 5.81 kB N/A N/A
webpack-10c7..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 5.92 kB N/A
main-ef93004..dule.js gzip N/A 5.79 kB N/A
Overall change 51.6 kB 51.6 kB ⚠️ +13 B
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/11608 Change
polyfills-75..1629.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-874bd8a..0103.js gzip 1.28 kB 1.28 kB
_error-fa39c..ec40.js gzip 3.45 kB 3.45 kB
hooks-585f07..95a3.js gzip 887 B 887 B
index-c7b63f..fc02.js gzip 227 B 227 B
link-f4d2979..e57b.js gzip 1.29 kB 1.29 kB
routerDirect..ebc7.js gzip 284 B 284 B
withRouter-2..db68.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-97e743e..dule.js gzip 626 B 626 B
_error-b4004..dule.js gzip 2.3 kB 2.3 kB
hooks-696209..dule.js gzip 387 B 387 B
index-a4dd74..dule.js gzip 226 B 226 B
link-653c74f..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-1..dule.js gzip 282 B 282 B
Overall change 5.37 kB 5.37 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/11608 Change
_buildManifest.js gzip 273 B 273 B
_buildManife..dule.js gzip 280 B 280 B
Overall change 553 B 553 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
_error.js 1.03 MB 1.03 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.03 MB 1.03 MB
link.js 1.07 MB 1.07 MB ⚠️ +168 B
routerDirect.js 1.06 MB 1.06 MB ⚠️ +168 B
withRouter.js 1.06 MB 1.06 MB ⚠️ +168 B
Overall change 5.26 MB 5.26 MB ⚠️ +504 B
Commit: 615e07a

@ijjk
Copy link
Member

ijjk commented Aug 10, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
buildDuration 13.7s 13.4s -214ms
nodeModulesSize 57.2 MB 57.2 MB ⚠️ +505 B
Page Load Tests Overall increase ✓
vercel/next.js canary Timer/next.js hotfix/11608 Change
/ failed reqs 0 0
/ total time (seconds) 2.678 2.597 -0.08
/ avg req/sec 933.4 962.71 +29.31
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.69 1.7 ⚠️ +0.01
/error-in-render avg req/sec 1479.21 1471.01 ⚠️ -8.2
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..ec1a.js gzip 9.99 kB 10 kB ⚠️ +25 B
framework.HASH.js gzip 39.1 kB 39.1 kB
main-d0ad4d2..1557.js gzip 6.74 kB 6.72 kB -12 B
webpack-ccf5..276a.js gzip 751 B 751 B
Overall change 56.6 kB 56.6 kB ⚠️ +13 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..dule.js gzip 5.89 kB 5.92 kB ⚠️ +30 B
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-1a596b6..dule.js gzip 5.81 kB 5.79 kB -16 B
webpack-10c7..dule.js gzip 751 B 751 B
Overall change 51.6 kB 51.6 kB ⚠️ +14 B
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/11608 Change
polyfills-75..1629.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-874bd8a..0103.js gzip 1.28 kB 1.28 kB
_error-fa39c..ec40.js gzip 3.45 kB 3.45 kB
hooks-585f07..95a3.js gzip 887 B 887 B
index-c7b63f..fc02.js gzip 227 B 227 B
link-f4d2979..e57b.js gzip 1.29 kB 1.29 kB
routerDirect..ebc7.js gzip 284 B 284 B
withRouter-2..db68.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-97e743e..dule.js gzip 626 B 626 B
_error-b4004..dule.js gzip 2.3 kB 2.3 kB
hooks-696209..dule.js gzip 387 B 387 B
index-a4dd74..dule.js gzip 226 B 226 B
link-653c74f..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-1..dule.js gzip 282 B 282 B
Overall change 5.37 kB 5.37 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/11608 Change
_buildManifest.js gzip 273 B 273 B
_buildManife..dule.js gzip 280 B 280 B
Overall change 553 B 553 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary Timer/next.js hotfix/11608 Change
index.html gzip 947 B 945 B -2 B
link.html gzip 952 B 953 B ⚠️ +1 B
withRouter.html gzip 940 B 940 B
Overall change 2.84 kB 2.84 kB -1 B

Diffs

Diff for 677f882d2ed8..01.module.js
@@ -537,6 +537,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.delBasePath = delBasePath;
       exports.isLocalURL = isLocalURL;
       exports.resolveHref = resolveHref;
+      exports.markLoadingError = markLoadingError;
       exports.default = void 0;
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
@@ -635,6 +636,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         }
       }
 
+      var PAGE_LOAD_ERROR = Symbol("PAGE_LOAD_ERROR");
+
+      function markLoadingError(err) {
+        return Object.defineProperty(err, PAGE_LOAD_ERROR, {});
+      }
+
       function prepareUrlAs(router, url, as) {
         // If url and as provided as an object representation,
         // we'll format them into the string version here.
@@ -690,7 +697,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // on a client-side transition. Otherwise, we'd get into an infinite
           // loop.
           if (!isServerRender) {
-            err.code = "PAGE_LOAD_ERROR";
+            markLoadingError(err);
           }
 
           throw err;
@@ -1085,7 +1092,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
             throw err;
           }
 
-          if (err.code === "PAGE_LOAD_ERROR" || loadErrorFail) {
+          if (PAGE_LOAD_ERROR in err || loadErrorFail) {
             Router.events.emit("routeChangeError", err, as); // If we can't load the page it could be one of following reasons
             //  1. Page doesn't exists
             //  2. Page does exist in a different zone
Diff for 677f882d2ed8..a52e0893d.js
@@ -678,6 +678,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       exports.delBasePath = delBasePath;
       exports.isLocalURL = isLocalURL;
       exports.resolveHref = resolveHref;
+      exports.markLoadingError = markLoadingError;
       exports["default"] = void 0;
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
@@ -776,6 +777,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
         }
       }
 
+      var PAGE_LOAD_ERROR = Symbol("PAGE_LOAD_ERROR");
+
+      function markLoadingError(err) {
+        return Object.defineProperty(err, PAGE_LOAD_ERROR, {});
+      }
+
       function prepareUrlAs(router, url, as) {
         // If url and as provided as an object representation,
         // we'll format them into the string version here.
@@ -833,7 +840,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
           // on a client-side transition. Otherwise, we'd get into an infinite
           // loop.
           if (!isServerRender) {
-            err.code = "PAGE_LOAD_ERROR";
+            markLoadingError(err);
           }
 
           throw err;
@@ -1400,9 +1407,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                             throw err;
 
                           case 2:
-                            if (
-                              !(err.code === "PAGE_LOAD_ERROR" || loadErrorFail)
-                            ) {
+                            if (!(PAGE_LOAD_ERROR in err || loadErrorFail)) {
                               _context2.next = 6;
                               break;
                             }
Diff for main-20849c6..1a6927331.js
@@ -1477,15 +1477,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
 
-      var _isDynamic = __webpack_require__("/jkW");
-
-      var _routeMatcher = __webpack_require__("gguc");
-
-      var _routeRegex = __webpack_require__("YTqd");
-
-      var _querystring = __webpack_require__("3WeD");
-
-      var _parseRelativeUrl = __webpack_require__("hS4m");
+      var _router = __webpack_require__("elyg");
 
       var _escapePathDelimiters = _interopRequireDefault(
         __webpack_require__("fcRV")
@@ -1495,7 +1487,15 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         __webpack_require__("Lab5")
       );
 
-      var _router = __webpack_require__("elyg");
+      var _isDynamic = __webpack_require__("/jkW");
+
+      var _parseRelativeUrl = __webpack_require__("hS4m");
+
+      var _querystring = __webpack_require__("3WeD");
+
+      var _routeMatcher = __webpack_require__("gguc");
+
+      var _routeRegex = __webpack_require__("YTqd");
 
       function hasRel(rel, link) {
         try {
@@ -1505,9 +1505,9 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
       }
 
       function pageLoadError(route) {
-        var error = new Error("Error loading ".concat(route));
-        error.code = "PAGE_LOAD_ERROR";
-        return error;
+        return (0, _router.markLoadingError)(
+          new Error("Error loading ".concat(route))
+        );
       }
 
       var relPrefetch =
Diff for main-7d2b9d2..b1.module.js
@@ -1116,15 +1116,7 @@
 
       var _mitt = _interopRequireDefault(__webpack_require__("dZ6Y"));
 
-      var _isDynamic = __webpack_require__("/jkW");
-
-      var _routeMatcher = __webpack_require__("gguc");
-
-      var _routeRegex = __webpack_require__("YTqd");
-
-      var _querystring = __webpack_require__("3WeD");
-
-      var _parseRelativeUrl = __webpack_require__("hS4m");
+      var _router = __webpack_require__("elyg");
 
       var _escapePathDelimiters = _interopRequireDefault(
         __webpack_require__("fcRV")
@@ -1134,7 +1126,15 @@
         __webpack_require__("Lab5")
       );
 
-      var _router = __webpack_require__("elyg");
+      var _isDynamic = __webpack_require__("/jkW");
+
+      var _parseRelativeUrl = __webpack_require__("hS4m");
+
+      var _querystring = __webpack_require__("3WeD");
+
+      var _routeMatcher = __webpack_require__("gguc");
+
+      var _routeRegex = __webpack_require__("YTqd");
 
       function hasRel(rel, link) {
         try {
@@ -1144,9 +1144,9 @@
       }
 
       function pageLoadError(route) {
-        var error = new Error("Error loading ".concat(route));
-        error.code = "PAGE_LOAD_ERROR";
-        return error;
+        return (0, _router.markLoadingError)(
+          new Error("Error loading ".concat(route))
+        );
       }
 
       var relPrefetch =
Diff for index.html
@@ -6,7 +6,7 @@
     <meta name="next-head-count" content="2" />
     <link
       rel="preload"
-      href="/_next/static/chunks/main-7d2b9d28b95d7efa6cb1.module.js"
+      href="/_next/static/chunks/main-610ace3a0296824e37ee.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -81,13 +81,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-20849c6db7a1a6927331.js"
+      src="/_next/static/chunks/main-3cef5ecdeeb9851a5911.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7d2b9d28b95d7efa6cb1.module.js"
+      src="/_next/static/chunks/main-610ace3a0296824e37ee.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2e522db0023a52e0893d.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for link.html
@@ -6,7 +6,7 @@
     <meta name="next-head-count" content="2" />
     <link
       rel="preload"
-      href="/_next/static/chunks/main-7d2b9d28b95d7efa6cb1.module.js"
+      href="/_next/static/chunks/main-610ace3a0296824e37ee.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -86,13 +86,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-20849c6db7a1a6927331.js"
+      src="/_next/static/chunks/main-3cef5ecdeeb9851a5911.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7d2b9d28b95d7efa6cb1.module.js"
+      src="/_next/static/chunks/main-610ace3a0296824e37ee.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -122,13 +122,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2e522db0023a52e0893d.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
Diff for withRouter.html
@@ -6,7 +6,7 @@
     <meta name="next-head-count" content="2" />
     <link
       rel="preload"
-      href="/_next/static/chunks/main-7d2b9d28b95d7efa6cb1.module.js"
+      href="/_next/static/chunks/main-610ace3a0296824e37ee.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -24,7 +24,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       as="script"
       crossorigin="anonymous"
     />
@@ -81,13 +81,13 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-20849c6db7a1a6927331.js"
+      src="/_next/static/chunks/main-3cef5ecdeeb9851a5911.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/main-7d2b9d28b95d7efa6cb1.module.js"
+      src="/_next/static/chunks/main-610ace3a0296824e37ee.module.js"
       async=""
       crossorigin="anonymous"
       type="module"
@@ -117,13 +117,13 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.2e522db0023a52e0893d.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.25e748ff47129ff1dba4.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.0a0ebfbd41e8343f0e01.module.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6e957134ad87644bd4a6.module.js"
       async=""
       crossorigin="anonymous"
       type="module"

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
buildDuration 15.7s 15.5s -186ms
nodeModulesSize 57.2 MB 57.2 MB ⚠️ +505 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..ec1a.js gzip 9.99 kB N/A N/A
framework.HASH.js gzip 39.1 kB 39.1 kB
main-d0ad4d2..1557.js gzip 6.74 kB N/A N/A
webpack-ccf5..276a.js gzip 751 B 751 B
677f882d2ed8..6aa6.js gzip N/A 10 kB N/A
main-0ee85b5..9240.js gzip N/A 6.72 kB N/A
Overall change 56.6 kB 56.6 kB ⚠️ +13 B
Client Bundles (main, webpack, commons) Modern Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
677f882d2ed8..dule.js gzip 5.89 kB N/A N/A
framework.HA..dule.js gzip 39.1 kB 39.1 kB
main-1a596b6..dule.js gzip 5.81 kB N/A N/A
webpack-10c7..dule.js gzip 751 B 751 B
677f882d2ed8..dule.js gzip N/A 5.92 kB N/A
main-d295757..dule.js gzip N/A 5.79 kB N/A
Overall change 51.6 kB 51.6 kB ⚠️ +14 B
Legacy Client Bundles (polyfills)
vercel/next.js canary Timer/next.js hotfix/11608 Change
polyfills-75..1629.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-874bd8a..0103.js gzip 1.28 kB 1.28 kB
_error-fa39c..ec40.js gzip 3.45 kB 3.45 kB
hooks-585f07..95a3.js gzip 887 B 887 B
index-c7b63f..fc02.js gzip 227 B 227 B
link-f4d2979..e57b.js gzip 1.29 kB 1.29 kB
routerDirect..ebc7.js gzip 284 B 284 B
withRouter-2..db68.js gzip 284 B 284 B
Overall change 7.71 kB 7.71 kB
Client Pages Modern
vercel/next.js canary Timer/next.js hotfix/11608 Change
_app-97e743e..dule.js gzip 626 B 626 B
_error-b4004..dule.js gzip 2.3 kB 2.3 kB
hooks-696209..dule.js gzip 387 B 387 B
index-a4dd74..dule.js gzip 226 B 226 B
link-653c74f..dule.js gzip 1.26 kB 1.26 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-1..dule.js gzip 282 B 282 B
Overall change 5.37 kB 5.37 kB
Client Build Manifests
vercel/next.js canary Timer/next.js hotfix/11608 Change
_buildManifest.js gzip 273 B 273 B
_buildManife..dule.js gzip 280 B 280 B
Overall change 553 B 553 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary Timer/next.js hotfix/11608 Change
_error.js 1.03 MB 1.03 MB
404.html 4.18 kB 4.18 kB
hooks.html 3.82 kB 3.82 kB
index.js 1.03 MB 1.03 MB
link.js 1.07 MB 1.07 MB ⚠️ +168 B
routerDirect.js 1.06 MB 1.06 MB ⚠️ +168 B
withRouter.js 1.06 MB 1.06 MB ⚠️ +168 B
Overall change 5.26 MB 5.26 MB ⚠️ +504 B
Commit: 478f05b

@Timer Timer merged commit 6d71eef into vercel:canary Aug 10, 2020
@Timer Timer deleted the hotfix/11608 branch August 10, 2020 17:15
@revolunet
Copy link

Awesome thanks

@Timer
Copy link
Member Author

Timer commented Aug 10, 2020

This was fixed in next@^9.5.2-canary.15 and newer. Please upgrade and let us know if it works for you @revolunet!

@revolunet
Copy link

revolunet commented Sep 10, 2020

I can confirm the error isn't raised anymore on Safari/IE11/Edge ! Thanks a lot 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fetchNextData error handling fails with TypeError: Attempted to assign to readonly property.
3 participants