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

Preserve asPath while resolving rewrites #21410

Merged
merged 5 commits into from
Jan 21, 2021

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jan 21, 2021

This ensures we don't modify the provided asPath value when resolving rewrites on the client since this value is used when triggering a full-navigation due to a page's data not being able to load. This also ensures that the rewrites resolving is only run when rewrites are present and not always enabled as it was in development since we didn't need to dead-code eliminate it. An additional test has been added to the production suite to ensure the asPath isn't modified by ensuring the query is still present since it was previously being dropped after resolving during a hard navigation.

Fixes: #21267
Fixes: #20058

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member Author

ijjk commented Jan 21, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
buildDuration 10.8s 11.1s ⚠️ +352ms
nodeModulesSize 73.3 MB 73.3 MB ⚠️ +1.18 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
/ failed reqs 0 0
/ total time (seconds) 2.08 2.118 ⚠️ +0.04
/ avg req/sec 1202.11 1180.35 ⚠️ -21.76
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.364 1.312 -0.05
/error-in-render avg req/sec 1832.61 1905.97 +73.36
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB ⚠️ +10 B
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB ⚠️ +10 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
index.html gzip 616 B 614 B -2 B
link.html gzip 621 B 619 B -2 B
withRouter.html gzip 609 B 607 B -2 B
Overall change 1.85 kB 1.84 kB -6 B

Diffs

Diff for 677f882d2ed8..d3759e1c6.js
@@ -397,6 +397,17 @@
       /***/
     },
 
+    /***/ GXs3: /***/ function(module, exports, __webpack_require__) {
+      "use strict";
+
+      exports.__esModule = true;
+      exports["default"] = resolveRewrites;
+
+      function resolveRewrites() {}
+
+      /***/
+    },
+
     /***/ J4zp: /***/ function(module, exports, __webpack_require__) {
       var arrayWithHoles = __webpack_require__("wTVA");
 
@@ -862,13 +873,6 @@
       /***/
     },
 
-    /***/ S3md: /***/ function(module, exports, __webpack_require__) {
-      "use strict";
-
-      /***/
-
-    },
-
     /***/ SksO: /***/ function(module, exports) {
       function _setPrototypeOf(o, p) {
         module.exports = _setPrototypeOf =
@@ -1208,7 +1212,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       var _querystring = __webpack_require__("3WeD");
 
       var _resolveRewrites = _interopRequireDefault(
-        __webpack_require__("S3md")
+        __webpack_require__("GXs3")
       );
 
       var _routeMatcher = __webpack_require__("gguc");
@@ -1836,7 +1840,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     _yield,
                     route,
                     resolvedAs,
-                    potentialHref,
+                    rewritesResult,
                     _parsedAs,
                     asPathname,
                     routeRegex,
@@ -2212,7 +2216,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               route,
                               pathname,
                               query,
-                              addBasePath(addLocale(resolvedAs, this.locale)),
+                              as,
+                              resolvedAs,
                               routeProps
                             );
 
@@ -2301,6 +2306,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               notFoundRoute,
                               query,
                               as,
+                              resolvedAs,
                               {
                                 shallow: false
                               }
@@ -2596,6 +2602,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   pathname,
                   query,
                   as,
+                  resolvedAs,
                   routeProps
                 ) {
                   var _this3 = this;
@@ -2709,7 +2716,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                   pathname: pathname,
                                   query: query
                                 }),
-                                delBasePath(as),
+                                resolvedAs,
                                 __N_SSG,
                                 this.locale
                               );
@@ -2764,7 +2771,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 })
               );
 
-              function getRouteInfo(_x12, _x13, _x14, _x15, _x16) {
+              function getRouteInfo(_x12, _x13, _x14, _x15, _x16, _x17) {
                 return _getRouteInfo.apply(this, arguments);
               }
 
@@ -3001,7 +3008,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 })
               );
 
-              function prefetch(_x17) {
+              function prefetch(_x18) {
                 return _prefetch.apply(this, arguments);
               }
 
@@ -3066,7 +3073,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 })
               );
 
-              function fetchComponent(_x18) {
+              function fetchComponent(_x19) {
                 return _fetchComponent.apply(this, arguments);
               }
Diff for index.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       as="script"
     />
     <link
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       as="script"
     />
     <link
@@ -70,7 +70,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       as="script"
     />
     <link
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       async=""
     ></script>
     <script

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
buildDuration 12.9s 12.9s ⚠️ +2ms
nodeModulesSize 73.3 MB 73.3 MB ⚠️ +1.18 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
677f882d2ed8..43e3.js gzip 13.1 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
677f882d2ed8..bb74.js gzip N/A 13.1 kB N/A
Overall change 59.4 kB 59.4 kB ⚠️ +10 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB ⚠️ +80 B
routerDirect.js 1.05 MB 1.05 MB ⚠️ +80 B
withRouter.js 1.05 MB 1.05 MB ⚠️ +80 B
Overall change 5.19 MB 5.19 MB ⚠️ +240 B

Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
buildDuration 13.2s 13.1s -59ms
nodeModulesSize 73.3 MB 73.3 MB ⚠️ +1.18 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
/ failed reqs 0 0
/ total time (seconds) 2.051 2.049 0
/ avg req/sec 1218.84 1220.02 +1.18
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.319 1.289 -0.03
/error-in-render avg req/sec 1895.52 1939.94 +44.42
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
597-3bd7d6bd..868b.js gzip 13 kB 13 kB ⚠️ +6 B
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.58 kB 6.58 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 59.8 kB 59.8 kB ⚠️ +6 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_app-a5b2e84..33cf.js gzip 1.26 kB 1.26 kB
_error-6f1f9..5577.js gzip 3.38 kB 3.38 kB
hooks-725de8..0a15.js gzip 904 B 904 B
index-939503..6e1c.js gzip 232 B 232 B
link-e0cc871..fdbb.js gzip 1.63 kB 1.63 kB
routerDirect..9360.js gzip 308 B 308 B
withRouter-6..44ec.js gzip 304 B 304 B
Overall change 8.02 kB 8.02 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_buildManifest.js gzip 299 B 299 B
Overall change 299 B 299 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
index.html gzip 585 B 587 B ⚠️ +2 B
link.html gzip 592 B 593 B ⚠️ +1 B
withRouter.html gzip 579 B 580 B ⚠️ +1 B
Overall change 1.76 kB 1.76 kB ⚠️ +4 B

Diffs

Diff for 677f882d2ed8..6a74e43e3.js
@@ -221,6 +221,10 @@
       }
       var a = /https?|ftp|gopher|file/;
     },
+    GXs3: function(t, e, r) {
+      "use strict";
+      (e.__esModule = !0), (e.default = function() {});
+    },
     J4zp: function(t, e, r) {
       var n = r("wTVA"),
         o = r("m0LI"),
@@ -531,7 +535,6 @@
       var n = Object.assign.bind(Object);
       (t.exports = n), (t.exports.default = t.exports);
     },
-    S3md: function(t, e, r) {},
     SksO: function(t, e) {
       function r(e, n) {
         return (
@@ -711,8 +714,8 @@
         }),
         (e.addLocale = b),
         (e.delLocale = _),
-        (e.hasBasePath = S),
-        (e.addBasePath = P),
+        (e.hasBasePath = P),
+        (e.addBasePath = S),
         (e.delBasePath = k),
         (e.isLocalURL = E),
         (e.interpolateAs = R),
@@ -726,7 +729,7 @@
         p = r("/jkW"),
         d = r("hS4m"),
         v = r("3WeD"),
-        y = (g(r("S3md")), r("gguc")),
+        y = (g(r("GXs3")), r("gguc")),
         m = r("YTqd");
       function g(t) {
         return t && t.__esModule ? t : { default: t };
@@ -745,10 +748,10 @@
           r = t.indexOf("#");
         return (e > -1 || r > -1) && (t = t.substring(0, e > -1 ? e : r)), t;
       }
-      function S(t) {
+      function P(t) {
         return "" === (t = x(t)) || t.startsWith("/");
       }
-      function P(t) {
+      function S(t) {
         return (function(t, e) {
           return e && t.startsWith("/")
             ? "/" === t
@@ -767,7 +770,7 @@
         try {
           var e = (0, h.getLocationOrigin)(),
             r = new URL(t, e);
-          return r.origin === e && S(r.pathname);
+          return r.origin === e && P(r.pathname);
         } catch (n) {
           return !1;
         }
@@ -855,9 +858,9 @@
           s = a.startsWith(c),
           l = i && i.startsWith(c);
         (a = C(a)), (i = i ? C(i) : i);
-        var f = s ? a : P(a),
+        var f = s ? a : S(a),
           p = r ? C(O(t.pathname, r)) : i || a;
-        return { url: f, as: l ? p : P(p) };
+        return { url: f, as: l ? p : S(p) };
       }
       var T = Symbol("SSG_DATA_NOT_FOUND");
       function I(t, e) {
@@ -879,7 +882,7 @@
           throw (e || (0, s.markAssetError)(t), t);
         });
       }
-      var D = (function() {
+      var M = (function() {
         function t(e, r, n, o) {
           var i = this,
             u = o.initialProps,
@@ -944,7 +947,7 @@
                   s = i.query;
                 i.changeState(
                   "replaceState",
-                  (0, h.formatWithValidation)({ pathname: P(c), query: s }),
+                  (0, h.formatWithValidation)({ pathname: S(c), query: s }),
                   (0, h.getURL)()
                 );
               }
@@ -981,7 +984,7 @@
             "//" !== n.substr(0, 2) &&
               this.changeState(
                 "replaceState",
-                (0, h.formatWithValidation)({ pathname: P(e), query: r }),
+                (0, h.formatWithValidation)({ pathname: S(e), query: r }),
                 (0, h.getURL)(),
                 { locale: w }
               ),
@@ -1042,19 +1045,19 @@
                       C,
                       I,
                       A,
-                      D,
                       M,
+                      D,
                       N,
                       U,
                       W,
                       F,
                       q,
-                      B,
                       G,
+                      B,
                       H,
                       V,
-                      z,
                       X,
+                      z,
                       J,
                       $,
                       Y,
@@ -1094,14 +1097,14 @@
                                     this._inFlightRoute,
                                     g
                                   ),
-                                (a = P(
+                                (a = S(
                                   b(
-                                    S(a) ? k(a) : a,
+                                    P(a) ? k(a) : a,
                                     i.locale,
                                     this.defaultLocale
                                   )
                                 )),
-                                (w = _(S(a) ? k(a) : a, this.locale)),
+                                (w = _(P(a) ? k(a) : a, this.locale)),
                                 (this._inFlightRoute = a),
                                 i._h || !this.onlyAHashChange(w))
                               ) {
@@ -1133,7 +1136,7 @@
                                 (0, s.getClientBuildManifest)()
                               );
                             case 42:
-                              (D = e.sent), D.__rewrites, (e.next = 50);
+                              (M = e.sent), M.__rewrites, (e.next = 50);
                               break;
                             case 46:
                               return (
@@ -1151,7 +1154,7 @@
                                   ? (0, c.removePathTrailingSlash)(k(C))
                                   : C),
                                 this.urlIsNew(w) || f || (r = "replaceState"),
-                                (M = (0, c.removePathTrailingSlash)(C)),
+                                (D = (0, c.removePathTrailingSlash)(C)),
                                 (N = a),
                                 E(a))
                               ) {
@@ -1168,7 +1171,7 @@
                             case 62:
                               if (
                                 ((N = _(k(N), this.locale)),
-                                !(0, p.isDynamicRoute)(M))
+                                !(0, p.isDynamicRoute)(D))
                               ) {
                                 e.next = 78;
                                 break;
@@ -1176,10 +1179,10 @@
                               if (
                                 ((U = (0, d.parseRelativeUrl)(N)),
                                 (W = U.pathname),
-                                (F = (0, m.getRouteRegex)(M)),
+                                (F = (0, m.getRouteRegex)(D)),
                                 (q = (0, y.getRouteMatcher)(F)(W)),
-                                (G = (B = M === W) ? R(M, W, I) : {}),
-                                q && (!B || G.result))
+                                (B = (G = D === W) ? R(D, W, I) : {}),
+                                q && (!G || B.result))
                               ) {
                                 e.next = 77;
                                 break;
@@ -1197,7 +1200,7 @@
                                 break;
                               }
                               throw new Error(
-                                (B
+                                (G
                                   ? "The provided `href` ("
                                       .concat(
                                         o,
@@ -1212,9 +1215,9 @@
                                         W,
                                         ") is incompatible with the `href` value ("
                                       )
-                                      .concat(M, "). ")) +
+                                      .concat(D, "). ")) +
                                   "Read more: https://err.sh/vercel/next.js/".concat(
-                                    B
+                                    G
                                       ? "href-interpolation-failed"
                                       : "incompatible-href-as"
                                   )
@@ -1223,11 +1226,11 @@
                               e.next = 78;
                               break;
                             case 77:
-                              B
+                              G
                                 ? (a = (0, h.formatWithValidation)(
                                     Object.assign({}, U, {
-                                      pathname: G.result,
-                                      query: L(I, G.params)
+                                      pathname: B.result,
+                                      query: L(I, B.params)
                                     })
                                   ))
                                 : Object.assign(I, q);
@@ -1236,21 +1239,15 @@
                                 t.events.emit("routeChangeStart", a, g),
                                 (e.prev = 79),
                                 (e.next = 82),
-                                this.getRouteInfo(
-                                  M,
-                                  C,
-                                  I,
-                                  P(b(N, this.locale)),
-                                  g
-                                )
+                                this.getRouteInfo(D, C, I, a, N, g)
                               );
                             case 82:
                               if (
                                 ((V = e.sent),
-                                (X = (z = V).error),
-                                (J = z.props),
-                                ($ = z.__N_SSG),
-                                (Y = z.__N_SSP),
+                                (z = (X = V).error),
+                                (J = X.props),
+                                ($ = X.__N_SSG),
+                                (Y = X.__N_SSP),
                                 (!$ && !Y) || !J)
                               ) {
                                 e.next = 108;
@@ -1305,7 +1302,9 @@
                             case 105:
                               return (
                                 (e.next = 107),
-                                this.getRouteInfo(rt, rt, I, a, { shallow: !1 })
+                                this.getRouteInfo(rt, rt, I, a, N, {
+                                  shallow: !1
+                                })
                               );
                             case 107:
                               V = e.sent;
@@ -1315,7 +1314,7 @@
                                 this.changeState(r, o, a, i),
                                 (e.next = 113),
                                 this.set(
-                                  M,
+                                  D,
                                   C,
                                   I,
                                   w,
@@ -1323,16 +1322,16 @@
                                   u || (i.scroll ? { x: 0, y: 0 } : null)
                                 ).catch(function(t) {
                                   if (!t.cancelled) throw t;
-                                  X = X || t;
+                                  z = z || t;
                                 })
                               );
                             case 113:
-                              if (!X) {
+                              if (!z) {
                                 e.next = 116;
                                 break;
                               }
-                              throw (t.events.emit("routeChangeError", X, w, g),
-                              X);
+                              throw (t.events.emit("routeChangeError", z, w, g),
+                              z);
                             case 116:
                               return (
                                 t.events.emit("routeChangeComplete", a, g),
@@ -1505,16 +1504,16 @@
               key: "getRouteInfo",
               value: (function() {
                 var t = o(
-                  n.mark(function t(e, r, o, a, i) {
-                    var u,
-                      c,
+                  n.mark(function t(e, r, o, a, i, u) {
+                    var c,
                       s,
                       l,
                       f,
                       p,
                       d,
                       v,
-                      y = this;
+                      y,
+                      m = this;
                     return n.wrap(
                       function(t) {
                         for (;;)
@@ -1522,19 +1521,19 @@
                             case 0:
                               if (
                                 ((t.prev = 0),
-                                (u = this.components[e]),
-                                !i.shallow || !u || this.route !== e)
+                                (c = this.components[e]),
+                                !u.shallow || !c || this.route !== e)
                               ) {
                                 t.next = 4;
                                 break;
                               }
-                              return t.abrupt("return", u);
+                              return t.abrupt("return", c);
                             case 4:
-                              if (!(c = u && "initial" in u ? void 0 : u)) {
+                              if (!(s = c && "initial" in c ? void 0 : c)) {
                                 t.next = 9;
                                 break;
                               }
-                              (t.t0 = c), (t.next = 12);
+                              (t.t0 = s), (t.next = 12);
                               break;
                             case 9:
                               return (
@@ -1551,31 +1550,31 @@
                             case 11:
                               t.t0 = t.sent;
                             case 12:
-                              (s = t.t0),
-                                (l = s.Component),
-                                (f = s.__N_SSG),
-                                (p = s.__N_SSP),
+                              (l = t.t0),
+                                (f = l.Component),
+                                (p = l.__N_SSG),
+                                (d = l.__N_SSP),
                                 (t.next = 18);
                               break;
                             case 18:
                               return (
-                                (f || p) &&
-                                  (d = this.pageLoader.getDataHref(
+                                (p || d) &&
+                                  (v = this.pageLoader.getDataHref(
                                     (0, h.formatWithValidation)({
                                       pathname: r,
                                       query: o
                                     }),
-                                    k(a),
-                                    f,
+                                    i,
+                                    p,
                                     this.locale
                                   )),
                                 (t.next = 21),
                                 this._getData(function() {
-                                  return f
-                                    ? y._getStaticData(d)
-                                    : p
-                                    ? y._getServerData(d)
-                                    : y.getInitialProps(l, {
+                                  return p
+                                    ? m._getStaticData(v)
+                                    : d
+                                    ? m._getServerData(v)
+                                    : m.getInitialProps(f, {
                                         pathname: r,
                                         query: o,
                                         asPath: a
@@ -1584,10 +1583,10 @@
                               );
                             case 21:
                               return (
-                                (v = t.sent),
-                                (s.props = v),
-                                (this.components[e] = s),
-                                t.abrupt("return", s)
+                                (y = t.sent),
+                                (l.props = y),
+                                (this.components[e] = l),
+                                t.abrupt("return", l)
                               );
                             case 27:
                               return (
@@ -1595,7 +1594,7 @@
                                 (t.t1 = t.catch(0)),
                                 t.abrupt(
                                   "return",
-                                  this.handleRouteInfoError(t.t1, r, o, a, i)
+                                  this.handleRouteInfoError(t.t1, r, o, a, u)
                                 )
                               );
                             case 30:
@@ -1609,7 +1608,7 @@
                     );
                   })
                 );
-                return function(e, r, n, o, a) {
+                return function(e, r, n, o, a, i) {
                   return t.apply(this, arguments);
                 };
               })()
@@ -1688,7 +1687,7 @@
                           (0, p.isDynamicRoute)(e) &&
                           (0, m.getRouteRegex)(e).re.test(o)
                         )
-                          return (t.pathname = r ? P(e) : e), !0;
+                          return (t.pathname = r ? S(e) : e), !0;
                       }),
                     (t.pathname = (0, c.removePathTrailingSlash)(t.pathname))),
                   t
@@ -1895,7 +1894,7 @@
           t
         );
       })();
-      (e.default = D), (D.events = (0, f.default)());
+      (e.default = M), (M.events = (0, f.default)());
     },
     "g/15": function(t, e, r) {
       "use strict";
@@ -2179,14 +2178,14 @@
           _ = b && b(b(O([])));
         _ && _ !== r && n.call(_, a) && (w = _);
         var x = (g.prototype = y.prototype = Object.create(w));
-        function S(t) {
+        function P(t) {
           ["next", "throw", "return"].forEach(function(e) {
             c(t, e, function(t) {
               return this._invoke(e, t);
             });
           });
         }
-        function P(t, e) {
+        function S(t, e) {
           function r(o, a, i, u) {
             var c = l(t[o], t, a);
             if ("throw" !== c.type) {
@@ -2318,21 +2317,21 @@
           (t.awrap = function(t) {
             return { __await: t };
           }),
-          S(P.prototype),
-          (P.prototype[i] = function() {
+          P(S.prototype),
+          (S.prototype[i] = function() {
             return this;
           }),
-          (t.AsyncIterator = P),
+          (t.AsyncIterator = S),
           (t.async = function(e, r, n, o, a) {
             void 0 === a && (a = Promise);
-            var i = new P(s(e, r, n, o), a);
+            var i = new S(s(e, r, n, o), a);
             return t.isGeneratorFunction(r)
               ? i
               : i.next().then(function(t) {
                   return t.done ? t.value : i.next();
                 });
           }),
-          S(x),
+          P(x),
           c(x, u, "Generator"),
           (x[a] = function() {
             return this;
Diff for index.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       as="script"
     />
     <link
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/",
         "query": {},
-        "buildId": "6sAac6uebZIXQyDo5gqAp",
+        "buildId": "5LIGPRMEyKcsz3cXxw31g",
         "isFallback": false,
         "gip": true
       }
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       async=""
     ></script>
     <script
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/6sAac6uebZIXQyDo5gqAp/_buildManifest.js"
+      src="/_next/static/5LIGPRMEyKcsz3cXxw31g/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/6sAac6uebZIXQyDo5gqAp/_ssgManifest.js"
+      src="/_next/static/5LIGPRMEyKcsz3cXxw31g/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for link.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       as="script"
     />
     <link
@@ -48,7 +48,7 @@
         "props": { "pageProps": {} },
         "page": "/link",
         "query": {},
-        "buildId": "6sAac6uebZIXQyDo5gqAp",
+        "buildId": "5LIGPRMEyKcsz3cXxw31g",
         "isFallback": false,
         "gip": true
       }
@@ -70,7 +70,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       async=""
     ></script>
     <script
@@ -82,11 +82,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/6sAac6uebZIXQyDo5gqAp/_buildManifest.js"
+      src="/_next/static/5LIGPRMEyKcsz3cXxw31g/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/6sAac6uebZIXQyDo5gqAp/_ssgManifest.js"
+      src="/_next/static/5LIGPRMEyKcsz3cXxw31g/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       as="script"
     />
     <link
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/withRouter",
         "query": {},
-        "buildId": "6sAac6uebZIXQyDo5gqAp",
+        "buildId": "5LIGPRMEyKcsz3cXxw31g",
         "isFallback": false,
         "gip": true
       }
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       async=""
     ></script>
     <script
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/6sAac6uebZIXQyDo5gqAp/_buildManifest.js"
+      src="/_next/static/5LIGPRMEyKcsz3cXxw31g/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/6sAac6uebZIXQyDo5gqAp/_ssgManifest.js"
+      src="/_next/static/5LIGPRMEyKcsz3cXxw31g/_ssgManifest.js"
       async=""
     ></script>
   </body>
Commit: 0c8f509

@ijjk ijjk marked this pull request as ready for review January 21, 2021 21:01
divmain
divmain previously approved these changes Jan 21, 2021
Copy link
Contributor

@divmain divmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, otherwise LGTM.

@ijjk
Copy link
Member Author

ijjk commented Jan 21, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
buildDuration 9.8s 10.6s ⚠️ +810ms
nodeModulesSize 73.3 MB 73.3 MB ⚠️ +1.19 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
/ failed reqs 0 0
/ total time (seconds) 2.017 2.106 ⚠️ +0.09
/ avg req/sec 1239.31 1186.88 ⚠️ -52.43
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.257 1.301 ⚠️ +0.04
/error-in-render avg req/sec 1988.86 1921.29 ⚠️ -67.57
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB ⚠️ +10 B
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB ⚠️ +10 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
index.html gzip 616 B 614 B -2 B
link.html gzip 621 B 619 B -2 B
withRouter.html gzip 609 B 607 B -2 B
Overall change 1.85 kB 1.84 kB -6 B

Diffs

Diff for 677f882d2ed8..d3759e1c6.js
@@ -397,6 +397,17 @@
       /***/
     },
 
+    /***/ GXs3: /***/ function(module, exports, __webpack_require__) {
+      "use strict";
+
+      exports.__esModule = true;
+      exports["default"] = resolveRewrites;
+
+      function resolveRewrites() {}
+
+      /***/
+    },
+
     /***/ J4zp: /***/ function(module, exports, __webpack_require__) {
       var arrayWithHoles = __webpack_require__("wTVA");
 
@@ -862,13 +873,6 @@
       /***/
     },
 
-    /***/ S3md: /***/ function(module, exports, __webpack_require__) {
-      "use strict";
-
-      /***/
-
-    },
-
     /***/ SksO: /***/ function(module, exports) {
       function _setPrototypeOf(o, p) {
         module.exports = _setPrototypeOf =
@@ -1208,7 +1212,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
       var _querystring = __webpack_require__("3WeD");
 
       var _resolveRewrites = _interopRequireDefault(
-        __webpack_require__("S3md")
+        __webpack_require__("GXs3")
       );
 
       var _routeMatcher = __webpack_require__("gguc");
@@ -1836,7 +1840,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                     _yield,
                     route,
                     resolvedAs,
-                    potentialHref,
+                    rewritesResult,
                     _parsedAs,
                     asPathname,
                     routeRegex,
@@ -2212,7 +2216,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               route,
                               pathname,
                               query,
-                              addBasePath(addLocale(resolvedAs, this.locale)),
+                              as,
+                              resolvedAs,
                               routeProps
                             );
 
@@ -2301,6 +2306,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                               notFoundRoute,
                               query,
                               as,
+                              resolvedAs,
                               {
                                 shallow: false
                               }
@@ -2596,6 +2602,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                   pathname,
                   query,
                   as,
+                  resolvedAs,
                   routeProps
                 ) {
                   var _this3 = this;
@@ -2709,7 +2716,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                                   pathname: pathname,
                                   query: query
                                 }),
-                                delBasePath(as),
+                                resolvedAs,
                                 __N_SSG,
                                 this.locale
                               );
@@ -2764,7 +2771,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 })
               );
 
-              function getRouteInfo(_x12, _x13, _x14, _x15, _x16) {
+              function getRouteInfo(_x12, _x13, _x14, _x15, _x16, _x17) {
                 return _getRouteInfo.apply(this, arguments);
               }
 
@@ -3001,7 +3008,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 })
               );
 
-              function prefetch(_x17) {
+              function prefetch(_x18) {
                 return _prefetch.apply(this, arguments);
               }
 
@@ -3066,7 +3073,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
                 })
               );
 
-              function fetchComponent(_x18) {
+              function fetchComponent(_x19) {
                 return _fetchComponent.apply(this, arguments);
               }
Diff for index.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       as="script"
     />
     <link
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       as="script"
     />
     <link
@@ -70,7 +70,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       as="script"
     />
     <link
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.68413f75a18d3759e1c6.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.8750478fa37ac9dfbed6.js"
       async=""
     ></script>
     <script

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
buildDuration 12.7s 12.1s -693ms
nodeModulesSize 73.3 MB 73.3 MB ⚠️ +1.19 kB
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
677f882d2ed8..43e3.js gzip 13.1 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
677f882d2ed8..bb74.js gzip N/A 13.1 kB N/A
Overall change 59.4 kB 59.4 kB ⚠️ +10 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB ⚠️ +80 B
routerDirect.js 1.05 MB 1.05 MB ⚠️ +80 B
withRouter.js 1.05 MB 1.05 MB ⚠️ +80 B
Overall change 5.19 MB 5.19 MB ⚠️ +240 B

Webpack 5 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
buildDuration 12.2s 11.9s -259ms
nodeModulesSize 73.3 MB 73.3 MB ⚠️ +1.19 kB
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
/ failed reqs 0 0
/ total time (seconds) 2.123 2.02 -0.1
/ avg req/sec 1177.48 1237.7 +60.22
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.368 1.253 -0.12
/error-in-render avg req/sec 1827.37 1995.33 +167.96
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
597-3bd7d6bd..868b.js gzip 13 kB 13 kB ⚠️ +6 B
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.58 kB 6.58 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 59.8 kB 59.8 kB ⚠️ +6 B
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_app-a5b2e84..33cf.js gzip 1.26 kB 1.26 kB
_error-6f1f9..5577.js gzip 3.38 kB 3.38 kB
hooks-725de8..0a15.js gzip 904 B 904 B
index-939503..6e1c.js gzip 232 B 232 B
link-e0cc871..fdbb.js gzip 1.63 kB 1.63 kB
routerDirect..9360.js gzip 308 B 308 B
withRouter-6..44ec.js gzip 304 B 304 B
Overall change 8.02 kB 8.02 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
_buildManifest.js gzip 299 B 299 B
Overall change 299 B 299 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary ijjk/next.js fix/aspath-query-resolving Change
index.html gzip 585 B 587 B ⚠️ +2 B
link.html gzip 592 B 593 B ⚠️ +1 B
withRouter.html gzip 579 B 580 B ⚠️ +1 B
Overall change 1.76 kB 1.76 kB ⚠️ +4 B

Diffs

Diff for 677f882d2ed8..6a74e43e3.js
@@ -221,6 +221,10 @@
       }
       var a = /https?|ftp|gopher|file/;
     },
+    GXs3: function(t, e, r) {
+      "use strict";
+      (e.__esModule = !0), (e.default = function() {});
+    },
     J4zp: function(t, e, r) {
       var n = r("wTVA"),
         o = r("m0LI"),
@@ -531,7 +535,6 @@
       var n = Object.assign.bind(Object);
       (t.exports = n), (t.exports.default = t.exports);
     },
-    S3md: function(t, e, r) {},
     SksO: function(t, e) {
       function r(e, n) {
         return (
@@ -711,8 +714,8 @@
         }),
         (e.addLocale = b),
         (e.delLocale = _),
-        (e.hasBasePath = S),
-        (e.addBasePath = P),
+        (e.hasBasePath = P),
+        (e.addBasePath = S),
         (e.delBasePath = k),
         (e.isLocalURL = E),
         (e.interpolateAs = R),
@@ -726,7 +729,7 @@
         p = r("/jkW"),
         d = r("hS4m"),
         v = r("3WeD"),
-        y = (g(r("S3md")), r("gguc")),
+        y = (g(r("GXs3")), r("gguc")),
         m = r("YTqd");
       function g(t) {
         return t && t.__esModule ? t : { default: t };
@@ -745,10 +748,10 @@
           r = t.indexOf("#");
         return (e > -1 || r > -1) && (t = t.substring(0, e > -1 ? e : r)), t;
       }
-      function S(t) {
+      function P(t) {
         return "" === (t = x(t)) || t.startsWith("/");
       }
-      function P(t) {
+      function S(t) {
         return (function(t, e) {
           return e && t.startsWith("/")
             ? "/" === t
@@ -767,7 +770,7 @@
         try {
           var e = (0, h.getLocationOrigin)(),
             r = new URL(t, e);
-          return r.origin === e && S(r.pathname);
+          return r.origin === e && P(r.pathname);
         } catch (n) {
           return !1;
         }
@@ -855,9 +858,9 @@
           s = a.startsWith(c),
           l = i && i.startsWith(c);
         (a = C(a)), (i = i ? C(i) : i);
-        var f = s ? a : P(a),
+        var f = s ? a : S(a),
           p = r ? C(O(t.pathname, r)) : i || a;
-        return { url: f, as: l ? p : P(p) };
+        return { url: f, as: l ? p : S(p) };
       }
       var T = Symbol("SSG_DATA_NOT_FOUND");
       function I(t, e) {
@@ -879,7 +882,7 @@
           throw (e || (0, s.markAssetError)(t), t);
         });
       }
-      var D = (function() {
+      var M = (function() {
         function t(e, r, n, o) {
           var i = this,
             u = o.initialProps,
@@ -944,7 +947,7 @@
                   s = i.query;
                 i.changeState(
                   "replaceState",
-                  (0, h.formatWithValidation)({ pathname: P(c), query: s }),
+                  (0, h.formatWithValidation)({ pathname: S(c), query: s }),
                   (0, h.getURL)()
                 );
               }
@@ -981,7 +984,7 @@
             "//" !== n.substr(0, 2) &&
               this.changeState(
                 "replaceState",
-                (0, h.formatWithValidation)({ pathname: P(e), query: r }),
+                (0, h.formatWithValidation)({ pathname: S(e), query: r }),
                 (0, h.getURL)(),
                 { locale: w }
               ),
@@ -1042,19 +1045,19 @@
                       C,
                       I,
                       A,
-                      D,
                       M,
+                      D,
                       N,
                       U,
                       W,
                       F,
                       q,
-                      B,
                       G,
+                      B,
                       H,
                       V,
-                      z,
                       X,
+                      z,
                       J,
                       $,
                       Y,
@@ -1094,14 +1097,14 @@
                                     this._inFlightRoute,
                                     g
                                   ),
-                                (a = P(
+                                (a = S(
                                   b(
-                                    S(a) ? k(a) : a,
+                                    P(a) ? k(a) : a,
                                     i.locale,
                                     this.defaultLocale
                                   )
                                 )),
-                                (w = _(S(a) ? k(a) : a, this.locale)),
+                                (w = _(P(a) ? k(a) : a, this.locale)),
                                 (this._inFlightRoute = a),
                                 i._h || !this.onlyAHashChange(w))
                               ) {
@@ -1133,7 +1136,7 @@
                                 (0, s.getClientBuildManifest)()
                               );
                             case 42:
-                              (D = e.sent), D.__rewrites, (e.next = 50);
+                              (M = e.sent), M.__rewrites, (e.next = 50);
                               break;
                             case 46:
                               return (
@@ -1151,7 +1154,7 @@
                                   ? (0, c.removePathTrailingSlash)(k(C))
                                   : C),
                                 this.urlIsNew(w) || f || (r = "replaceState"),
-                                (M = (0, c.removePathTrailingSlash)(C)),
+                                (D = (0, c.removePathTrailingSlash)(C)),
                                 (N = a),
                                 E(a))
                               ) {
@@ -1168,7 +1171,7 @@
                             case 62:
                               if (
                                 ((N = _(k(N), this.locale)),
-                                !(0, p.isDynamicRoute)(M))
+                                !(0, p.isDynamicRoute)(D))
                               ) {
                                 e.next = 78;
                                 break;
@@ -1176,10 +1179,10 @@
                               if (
                                 ((U = (0, d.parseRelativeUrl)(N)),
                                 (W = U.pathname),
-                                (F = (0, m.getRouteRegex)(M)),
+                                (F = (0, m.getRouteRegex)(D)),
                                 (q = (0, y.getRouteMatcher)(F)(W)),
-                                (G = (B = M === W) ? R(M, W, I) : {}),
-                                q && (!B || G.result))
+                                (B = (G = D === W) ? R(D, W, I) : {}),
+                                q && (!G || B.result))
                               ) {
                                 e.next = 77;
                                 break;
@@ -1197,7 +1200,7 @@
                                 break;
                               }
                               throw new Error(
-                                (B
+                                (G
                                   ? "The provided `href` ("
                                       .concat(
                                         o,
@@ -1212,9 +1215,9 @@
                                         W,
                                         ") is incompatible with the `href` value ("
                                       )
-                                      .concat(M, "). ")) +
+                                      .concat(D, "). ")) +
                                   "Read more: https://err.sh/vercel/next.js/".concat(
-                                    B
+                                    G
                                       ? "href-interpolation-failed"
                                       : "incompatible-href-as"
                                   )
@@ -1223,11 +1226,11 @@
                               e.next = 78;
                               break;
                             case 77:
-                              B
+                              G
                                 ? (a = (0, h.formatWithValidation)(
                                     Object.assign({}, U, {
-                                      pathname: G.result,
-                                      query: L(I, G.params)
+                                      pathname: B.result,
+                                      query: L(I, B.params)
                                     })
                                   ))
                                 : Object.assign(I, q);
@@ -1236,21 +1239,15 @@
                                 t.events.emit("routeChangeStart", a, g),
                                 (e.prev = 79),
                                 (e.next = 82),
-                                this.getRouteInfo(
-                                  M,
-                                  C,
-                                  I,
-                                  P(b(N, this.locale)),
-                                  g
-                                )
+                                this.getRouteInfo(D, C, I, a, N, g)
                               );
                             case 82:
                               if (
                                 ((V = e.sent),
-                                (X = (z = V).error),
-                                (J = z.props),
-                                ($ = z.__N_SSG),
-                                (Y = z.__N_SSP),
+                                (z = (X = V).error),
+                                (J = X.props),
+                                ($ = X.__N_SSG),
+                                (Y = X.__N_SSP),
                                 (!$ && !Y) || !J)
                               ) {
                                 e.next = 108;
@@ -1305,7 +1302,9 @@
                             case 105:
                               return (
                                 (e.next = 107),
-                                this.getRouteInfo(rt, rt, I, a, { shallow: !1 })
+                                this.getRouteInfo(rt, rt, I, a, N, {
+                                  shallow: !1
+                                })
                               );
                             case 107:
                               V = e.sent;
@@ -1315,7 +1314,7 @@
                                 this.changeState(r, o, a, i),
                                 (e.next = 113),
                                 this.set(
-                                  M,
+                                  D,
                                   C,
                                   I,
                                   w,
@@ -1323,16 +1322,16 @@
                                   u || (i.scroll ? { x: 0, y: 0 } : null)
                                 ).catch(function(t) {
                                   if (!t.cancelled) throw t;
-                                  X = X || t;
+                                  z = z || t;
                                 })
                               );
                             case 113:
-                              if (!X) {
+                              if (!z) {
                                 e.next = 116;
                                 break;
                               }
-                              throw (t.events.emit("routeChangeError", X, w, g),
-                              X);
+                              throw (t.events.emit("routeChangeError", z, w, g),
+                              z);
                             case 116:
                               return (
                                 t.events.emit("routeChangeComplete", a, g),
@@ -1505,16 +1504,16 @@
               key: "getRouteInfo",
               value: (function() {
                 var t = o(
-                  n.mark(function t(e, r, o, a, i) {
-                    var u,
-                      c,
+                  n.mark(function t(e, r, o, a, i, u) {
+                    var c,
                       s,
                       l,
                       f,
                       p,
                       d,
                       v,
-                      y = this;
+                      y,
+                      m = this;
                     return n.wrap(
                       function(t) {
                         for (;;)
@@ -1522,19 +1521,19 @@
                             case 0:
                               if (
                                 ((t.prev = 0),
-                                (u = this.components[e]),
-                                !i.shallow || !u || this.route !== e)
+                                (c = this.components[e]),
+                                !u.shallow || !c || this.route !== e)
                               ) {
                                 t.next = 4;
                                 break;
                               }
-                              return t.abrupt("return", u);
+                              return t.abrupt("return", c);
                             case 4:
-                              if (!(c = u && "initial" in u ? void 0 : u)) {
+                              if (!(s = c && "initial" in c ? void 0 : c)) {
                                 t.next = 9;
                                 break;
                               }
-                              (t.t0 = c), (t.next = 12);
+                              (t.t0 = s), (t.next = 12);
                               break;
                             case 9:
                               return (
@@ -1551,31 +1550,31 @@
                             case 11:
                               t.t0 = t.sent;
                             case 12:
-                              (s = t.t0),
-                                (l = s.Component),
-                                (f = s.__N_SSG),
-                                (p = s.__N_SSP),
+                              (l = t.t0),
+                                (f = l.Component),
+                                (p = l.__N_SSG),
+                                (d = l.__N_SSP),
                                 (t.next = 18);
                               break;
                             case 18:
                               return (
-                                (f || p) &&
-                                  (d = this.pageLoader.getDataHref(
+                                (p || d) &&
+                                  (v = this.pageLoader.getDataHref(
                                     (0, h.formatWithValidation)({
                                       pathname: r,
                                       query: o
                                     }),
-                                    k(a),
-                                    f,
+                                    i,
+                                    p,
                                     this.locale
                                   )),
                                 (t.next = 21),
                                 this._getData(function() {
-                                  return f
-                                    ? y._getStaticData(d)
-                                    : p
-                                    ? y._getServerData(d)
-                                    : y.getInitialProps(l, {
+                                  return p
+                                    ? m._getStaticData(v)
+                                    : d
+                                    ? m._getServerData(v)
+                                    : m.getInitialProps(f, {
                                         pathname: r,
                                         query: o,
                                         asPath: a
@@ -1584,10 +1583,10 @@
                               );
                             case 21:
                               return (
-                                (v = t.sent),
-                                (s.props = v),
-                                (this.components[e] = s),
-                                t.abrupt("return", s)
+                                (y = t.sent),
+                                (l.props = y),
+                                (this.components[e] = l),
+                                t.abrupt("return", l)
                               );
                             case 27:
                               return (
@@ -1595,7 +1594,7 @@
                                 (t.t1 = t.catch(0)),
                                 t.abrupt(
                                   "return",
-                                  this.handleRouteInfoError(t.t1, r, o, a, i)
+                                  this.handleRouteInfoError(t.t1, r, o, a, u)
                                 )
                               );
                             case 30:
@@ -1609,7 +1608,7 @@
                     );
                   })
                 );
-                return function(e, r, n, o, a) {
+                return function(e, r, n, o, a, i) {
                   return t.apply(this, arguments);
                 };
               })()
@@ -1688,7 +1687,7 @@
                           (0, p.isDynamicRoute)(e) &&
                           (0, m.getRouteRegex)(e).re.test(o)
                         )
-                          return (t.pathname = r ? P(e) : e), !0;
+                          return (t.pathname = r ? S(e) : e), !0;
                       }),
                     (t.pathname = (0, c.removePathTrailingSlash)(t.pathname))),
                   t
@@ -1895,7 +1894,7 @@
           t
         );
       })();
-      (e.default = D), (D.events = (0, f.default)());
+      (e.default = M), (M.events = (0, f.default)());
     },
     "g/15": function(t, e, r) {
       "use strict";
@@ -2179,14 +2178,14 @@
           _ = b && b(b(O([])));
         _ && _ !== r && n.call(_, a) && (w = _);
         var x = (g.prototype = y.prototype = Object.create(w));
-        function S(t) {
+        function P(t) {
           ["next", "throw", "return"].forEach(function(e) {
             c(t, e, function(t) {
               return this._invoke(e, t);
             });
           });
         }
-        function P(t, e) {
+        function S(t, e) {
           function r(o, a, i, u) {
             var c = l(t[o], t, a);
             if ("throw" !== c.type) {
@@ -2318,21 +2317,21 @@
           (t.awrap = function(t) {
             return { __await: t };
           }),
-          S(P.prototype),
-          (P.prototype[i] = function() {
+          P(S.prototype),
+          (S.prototype[i] = function() {
             return this;
           }),
-          (t.AsyncIterator = P),
+          (t.AsyncIterator = S),
           (t.async = function(e, r, n, o, a) {
             void 0 === a && (a = Promise);
-            var i = new P(s(e, r, n, o), a);
+            var i = new S(s(e, r, n, o), a);
             return t.isGeneratorFunction(r)
               ? i
               : i.next().then(function(t) {
                   return t.done ? t.value : i.next();
                 });
           }),
-          S(x),
+          P(x),
           c(x, u, "Generator"),
           (x[a] = function() {
             return this;
Diff for index.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       as="script"
     />
     <link
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/",
         "query": {},
-        "buildId": "WiK1e7yY2VqhFbokMhLiA",
+        "buildId": "xzZ_fbhqRWOYxOOeLFy0p",
         "isFallback": false,
         "gip": true
       }
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       async=""
     ></script>
     <script
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/WiK1e7yY2VqhFbokMhLiA/_buildManifest.js"
+      src="/_next/static/xzZ_fbhqRWOYxOOeLFy0p/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/WiK1e7yY2VqhFbokMhLiA/_ssgManifest.js"
+      src="/_next/static/xzZ_fbhqRWOYxOOeLFy0p/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for link.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       as="script"
     />
     <link
@@ -48,7 +48,7 @@
         "props": { "pageProps": {} },
         "page": "/link",
         "query": {},
-        "buildId": "WiK1e7yY2VqhFbokMhLiA",
+        "buildId": "xzZ_fbhqRWOYxOOeLFy0p",
         "isFallback": false,
         "gip": true
       }
@@ -70,7 +70,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       async=""
     ></script>
     <script
@@ -82,11 +82,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/WiK1e7yY2VqhFbokMhLiA/_buildManifest.js"
+      src="/_next/static/xzZ_fbhqRWOYxOOeLFy0p/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/WiK1e7yY2VqhFbokMhLiA/_ssgManifest.js"
+      src="/_next/static/xzZ_fbhqRWOYxOOeLFy0p/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for withRouter.html
@@ -22,7 +22,7 @@
     />
     <link
       rel="preload"
-      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      href="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       as="script"
     />
     <link
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/withRouter",
         "query": {},
-        "buildId": "WiK1e7yY2VqhFbokMhLiA",
+        "buildId": "xzZ_fbhqRWOYxOOeLFy0p",
         "isFallback": false,
         "gip": true
       }
@@ -65,7 +65,7 @@
       async=""
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.7457634b2036a74e43e3.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.203a9b065a4d6246bb74.js"
       async=""
     ></script>
     <script
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/WiK1e7yY2VqhFbokMhLiA/_buildManifest.js"
+      src="/_next/static/xzZ_fbhqRWOYxOOeLFy0p/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/WiK1e7yY2VqhFbokMhLiA/_ssgManifest.js"
+      src="/_next/static/xzZ_fbhqRWOYxOOeLFy0p/_ssgManifest.js"
       async=""
     ></script>
   </body>
Commit: e6846b8

Copy link
Contributor

@divmain divmain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ijjk ijjk merged commit 5b70802 into vercel:canary Jan 21, 2021
@ijjk ijjk deleted the fix/aspath-query-resolving branch January 21, 2021 23:40
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
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.

asPath in getInitialProps ignores query params in dev mode Router bug with Catch-All routes
2 participants