File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/next/src/build/webpack/loaders/next-app-loader Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -682,7 +682,14 @@ const nextAppLoader: AppLoader = async function nextAppLoader() {
682682
683683 const buildInfo = getModuleBuildInfo ( ( this as any ) . _module )
684684 const collectedDeclarations : [ string , string ] [ ] = [ ]
685- const page = name . replace ( / ^ a p p / , '' )
685+
686+ // Use the page from loaderOptions directly instead of deriving it from name.
687+ // The name (bundlePath) may have been normalized with normalizePagePath()
688+ // which is designed for Pages Router and incorrectly duplicates /index paths
689+ // (e.g., /index/page -> /index/index/page). The page parameter contains the
690+ // correct unnormalized value.
691+ const page = loaderOptions . page
692+
686693 const middlewareConfig : ProxyConfig = JSON . parse (
687694 Buffer . from ( middlewareConfigBase64 , 'base64' ) . toString ( )
688695 )
You can’t perform that action at this time.
0 commit comments