Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix dynamic route interception not working when deployed with middleware#64923

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

ztanner
Copy link
Member

@ztannerztanner commentedApr 23, 2024
edited
Loading

We currently have logic spread in multiple places that normalizenxtP parameters into their regular names, ienxtPfoo ->foo. However we don't apply this same logic tonxtI, which conceptually is another parameter but for route interception. As a result, the interception route would 404 when deployed because it'd be missing the interception parameter.

This moves the normalization check into a util and updates the spots I could find where we handlenxtP to also handlenxtI.

Test Plan

Added a new test, and validated via these deploys:

Working:Link
Non-Working:Link

Fixes#62207
ClosesNEXT-3204

@ijjkijjk added created-by: Next.js teamPRs by the Next.js team. type: next labelsApr 23, 2024
@ztannerGraphite App
Copy link
MemberAuthor

This stack of pull requests is managed by Graphite.Learn more about stacking.

Join@ztanner and the rest of your teammates onGraphiteGraphite

@ijjk
Copy link
Member

ijjk commentedApr 23, 2024
edited
Loading

Tests Passed

@ijjk
Copy link
Member

Stats from current PR

Default Build (Increase detected⚠️)
General Overall increase⚠️
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
buildDuration14.9s15.1s⚠️ +187ms
buildDurationCached8.3s7sN/A
nodeModulesSize238 MB238 MB⚠️ +12.7 kB
nextStartRea..uration (ms)409ms411msN/A
Client Bundles (main, webpack) Overall increase⚠️
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
2453-HASH.js gzip31.5 kB31.5 kBN/A
3304.HASH.js gzip169 B169 B
3f784ff6-HASH.js gzip53.7 kB53.7 kBN/A
8299-HASH.js gzip5.09 kB5.09 kB
framework-HASH.js gzip45.2 kB45.2 kB
main-app-HASH.js gzip228 B227 BN/A
main-HASH.js gzip29.6 kB31.6 kB⚠️ +1.93 kB
webpack-HASH.js gzip1.64 kB1.65 kBN/A
Overall change80.1 kB82 kB⚠️ +1.93 kB
Legacy Client Bundles (polyfills)
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
polyfills-HASH.js gzip31 kB31 kB
Overall change31 kB31 kB
Client Pages
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
_app-HASH.js gzip193 B194 BN/A
_error-HASH.js gzip193 B191 BN/A
amp-HASH.js gzip510 B510 B
css-HASH.js gzip342 B343 BN/A
dynamic-HASH.js gzip2.51 kB2.52 kBN/A
edge-ssr-HASH.js gzip265 B265 B
head-HASH.js gzip365 B364 BN/A
hooks-HASH.js gzip389 B391 BN/A
image-HASH.js gzip4.28 kB4.28 kBN/A
index-HASH.js gzip269 B268 BN/A
link-HASH.js gzip2.68 kB2.69 kBN/A
routerDirect..HASH.js gzip328 B326 BN/A
script-HASH.js gzip395 B397 BN/A
withRouter-HASH.js gzip323 B323 B
1afbb74e6ecf..834.css gzip106 B106 B
Overall change1.2 kB1.2 kB
Client Build Manifests
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
_buildManifest.js gzip482 B482 B
Overall change482 B482 B
Rendered Page Sizes
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
index.html gzip528 B530 BN/A
link.html gzip540 B541 BN/A
withRouter.html gzip523 B524 BN/A
Overall change0 B0 B
Edge SSR bundle Size
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
edge-ssr.js gzip108 kB108 kBN/A
page.js gzip3.05 kB3.04 kBN/A
Overall change0 B0 B
Middleware size Overall increase⚠️
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
middleware-b..fest.js gzip623 B624 BN/A
middleware-r..fest.js gzip155 B156 BN/A
middleware.js gzip25.6 kB27.8 kB⚠️ +2.21 kB
edge-runtime..pack.js gzip839 B839 B
Overall change26.4 kB28.6 kB⚠️ +2.21 kB
Next Runtimes
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
app-page-exp...dev.js gzip171 kB171 kB
app-page-exp..prod.js gzip97.6 kB97.6 kB
app-page-tur..prod.js gzip99.4 kB99.4 kB
app-page-tur..prod.js gzip93.6 kB93.6 kB
app-page.run...dev.js gzip145 kB145 kB
app-page.run..prod.js gzip92.1 kB92.1 kB
app-route-ex...dev.js gzip21.5 kB21.5 kB
app-route-ex..prod.js gzip15.1 kB15.1 kB
app-route-tu..prod.js gzip15.1 kB15.1 kB
app-route-tu..prod.js gzip14.9 kB14.9 kB
app-route.ru...dev.js gzip21.2 kB21.2 kB
app-route.ru..prod.js gzip14.9 kB14.9 kB
pages-api-tu..prod.js gzip9.55 kB9.55 kB
pages-api.ru...dev.js gzip9.82 kB9.82 kB
pages-api.ru..prod.js gzip9.55 kB9.55 kB
pages-turbo...prod.js gzip21.4 kB21.4 kB
pages.runtim...dev.js gzip22.1 kB22.1 kB
pages.runtim..prod.js gzip21.4 kB21.4 kB
server.runti..prod.js gzip65.3 kB65.3 kBN/A
Overall change895 kB895 kB
build cache Overall increase⚠️
vercel/next.js canaryvercel/next.js 04-23-fix_dynamic_route_interception_not_working_when_deployedChange
0.pack gzip1.6 MB1.61 MB⚠️ +13.3 kB
index.pack gzip106 kB106 kBN/A
Overall change1.6 MB1.61 MB⚠️ +13.3 kB
Diff details
Diff formiddleware.js

Diff too large to display

Diff foredge-ssr.js

Diff too large to display

Diff forimage-HASH.js
@@ -1,7 +1,7 @@ (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([   [8358],   {-    /***/ 1552: /***/ (+    /***/ 4070: /***/ (       __unused_webpack_module,       __unused_webpack_exports,       __webpack_require__@@ -9,7 +9,7 @@       (window.__NEXT_P = window.__NEXT_P || []).push([         "/image",         function () {-          return __webpack_require__(5237);+          return __webpack_require__(396);         },       ]);       if (false) {@@ -18,7 +18,7 @@       /***/     },-    /***/ 2016: /***/ (module, exports, __webpack_require__) => {+    /***/ 8490: /***/ (module, exports, __webpack_require__) => {       "use strict";       /* __next_internal_client_entry_do_not_use__  cjs */       Object.defineProperty(exports, "__esModule", {@@ -40,15 +40,15 @@         __webpack_require__(422)       );       const _head = /*#__PURE__*/ _interop_require_default._(-        __webpack_require__(6074)+        __webpack_require__(2457)       );-      const _getimgprops = __webpack_require__(9571);-      const _imageconfig = __webpack_require__(6567);-      const _imageconfigcontextsharedruntime = __webpack_require__(419);-      const _warnonce = __webpack_require__(4486);-      const _routercontextsharedruntime = __webpack_require__(162);+      const _getimgprops = __webpack_require__(7932);+      const _imageconfig = __webpack_require__(5706);+      const _imageconfigcontextsharedruntime = __webpack_require__(9483);+      const _warnonce = __webpack_require__(9035);+      const _routercontextsharedruntime = __webpack_require__(4829);       const _imageloader = /*#__PURE__*/ _interop_require_default._(-        __webpack_require__(6996)+        __webpack_require__(7240)       );       // This is replaced by webpack define plugin       const configEnv = {@@ -379,7 +379,7 @@       /***/     },-    /***/ 9571: /***/ (+    /***/ 7932: /***/ (       __unused_webpack_module,       exports,       __webpack_require__@@ -395,9 +395,9 @@           return getImgProps;         },       });-      const _warnonce = __webpack_require__(4486);-      const _imageblursvg = __webpack_require__(133);-      const _imageconfig = __webpack_require__(6567);+      const _warnonce = __webpack_require__(9035);+      const _imageblursvg = __webpack_require__(2642);+      const _imageconfig = __webpack_require__(5706);       const VALID_LOADING_VALUES =         /* unused pure expression or super */ null && [           "lazy",@@ -772,7 +772,7 @@       /***/     },-    /***/ 133: /***/ (__unused_webpack_module, exports) => {+    /***/ 2642: /***/ (__unused_webpack_module, exports) => {       "use strict";       /**        * A shared function, used on both client and server, to generate a SVG blur placeholder.@@ -827,7 +827,7 @@       /***/     },-    /***/ 4085: /***/ (+    /***/ 503: /***/ (       __unused_webpack_module,       exports,       __webpack_require__@@ -854,10 +854,10 @@         },       });       const _interop_require_default = __webpack_require__(7456);-      const _getimgprops = __webpack_require__(9571);-      const _imagecomponent = __webpack_require__(2016);+      const _getimgprops = __webpack_require__(7932);+      const _imagecomponent = __webpack_require__(8490);       const _imageloader = /*#__PURE__*/ _interop_require_default._(-        __webpack_require__(6996)+        __webpack_require__(7240)       );       function getImageProps(imgProps) {         const { props } = (0, _getimgprops.getImgProps)(imgProps, {@@ -889,7 +889,7 @@       /***/     },-    /***/ 6996: /***/ (__unused_webpack_module, exports) => {+    /***/ 7240: /***/ (__unused_webpack_module, exports) => {       "use strict";        Object.defineProperty(exports, "__esModule", {@@ -924,7 +924,7 @@       /***/     },-    /***/ 5237: /***/ (+    /***/ 396: /***/ (       __unused_webpack_module,       __webpack_exports__,       __webpack_require__@@ -941,8 +941,8 @@        // EXTERNAL MODULE: ./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js       var jsx_runtime = __webpack_require__(1527);-      // EXTERNAL MODULE: ./node_modules/.pnpm/file+..+main-repo+packages+next+next-packed.tgz_react-dom@18.2.0_react@18.2.0/node_modules/next/image.js-      var next_image = __webpack_require__(1577);+      // EXTERNAL MODULE: ./node_modules/.pnpm/file+..+diff-repo+packages+next+next-packed.tgz_react-dom@18.2.0_react@18.2.0/node_modules/next/image.js+      var next_image = __webpack_require__(73);       var image_default = /*#__PURE__*/ __webpack_require__.n(next_image); // CONCATENATED MODULE: ./pages/nextjs.png       /* harmony default export */ const nextjs = {         src: "/_next/static/media/nextjs.cae0b805.png",@@ -972,12 +972,8 @@       /***/     },-    /***/ 1577: /***/ (-      module,-      __unused_webpack_exports,-      __webpack_require__-    ) => {-      module.exports = __webpack_require__(4085);+    /***/ 73: /***/ (module, __unused_webpack_exports, __webpack_require__) => {+      module.exports = __webpack_require__(503);        /***/     },@@ -987,7 +983,7 @@     /******/ var __webpack_exec__ = (moduleId) =>       __webpack_require__((__webpack_require__.s = moduleId));     /******/ __webpack_require__.O(0, [2888, 9774, 179], () =>-      __webpack_exec__(1552)+      __webpack_exec__(4070)     );     /******/ var __webpack_exports__ = __webpack_require__.O();     /******/ _N_E = __webpack_exports__;
Diff for2453-HASH.js

Diff too large to display

Diff formain-HASH.js

Diff too large to display

Diff forserver.runtime.prod.js

Diff too large to display

Commit:6711d8a

@ztannerztannerforce-pushed the04-23-fix_dynamic_route_interception_not_working_when_deployed branch from6711d8a toec6cba1CompareApril 23, 2024 17:37
@ijjkijjk added the tests labelApr 23, 2024
@ztannerztanner changed the titlefix dynamic route interception not working when deployedfix dynamic route interception not working when deployed with middlewareApr 23, 2024
@ztannerztanner marked this pull request as ready for reviewApril 23, 2024 17:56
@ztannerztanner merged commitf50ef62 intocanaryApr 23, 2024
@ztannerztanner deleted the 04-23-fix_dynamic_route_interception_not_working_when_deployed branchApril 23, 2024 19:02
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMay 9, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@ijjkijjkijjk approved these changes

@timneutkenstimneutkensAwaiting requested review from timneutkens

@shudingshudingAwaiting requested review from shuding

@huozhihuozhiAwaiting requested review from huozhi

@feedthejimfeedthejimAwaiting requested review from feedthejim

@wyattjohwyattjohAwaiting requested review from wyattjoh

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Intercepting + Dynamic Routes, Jumping the page causes a forced refresh
2 participants
@ztanner@ijjk

[8]ページ先頭

©2009-2025 Movatter.jp