rsnext/packages/next/next-server/lib
Jan Potoms bc2cb2210f
Fix prerendered nested index handling (#14383)
Noticed this while reviewing https://github.com/vercel/next.js/pull/14376. After having done https://github.com/vercel/next.js/pull/13699, this code didn't feel right to me:
```js
function prepareRoute(path: string) {
  path = delBasePath(path || '')
  // this /index rewrite is problematic, it makes pages/index.js 
  // and pages/index/index.js point to the same thing:
  return toRoute(!path || path === '/' ? '/index' : path)
}
```
Added a nested index page to the prerender tests and found it was rendering the `/` route on navigation. This uncovered 2 more places around the dataroute where the index path was not translated correctly.

**edit:**

Just to note that there was nothing wrong with https://github.com/vercel/next.js/pull/14376, the issue was already there, I just noticed it while reading that PR
2020-06-23 05:49:48 +00:00
..
router Fix prerendered nested index handling (#14383) 2020-06-23 05:49:48 +00:00
amp-context.ts Add sourcemaps to Next.js core compilation (#13049) 2020-05-19 09:09:59 +02:00
amp.ts chore(next): export/lib/next-server missing types (#13320) 2020-05-24 22:44:05 +00:00
constants.ts Update filename generation for client-side compilation (#14279) 2020-06-20 19:59:47 +00:00
document-context.ts Add sourcemaps to Next.js core compilation (#13049) 2020-05-19 09:09:59 +02:00
dynamic.tsx chore: add retry method to loadable types (#14152) 2020-06-15 14:21:03 +02:00
head-manager-context.ts Remove Head.rewind as it's no longer needed (#14091) 2020-06-11 22:09:06 +00:00
head.tsx Remove Head.rewind as it's no longer needed (#14091) 2020-06-11 22:09:06 +00:00
loadable-context.ts Add sourcemaps to Next.js core compilation (#13049) 2020-05-19 09:09:59 +02:00
loadable.d.ts Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
loadable.js Remove unused variable (#13716) 2020-06-03 11:58:58 -04:00
mitt.ts Improve linting rules to catch more errors (#9374) 2019-11-10 19:24:53 -08:00
router-context.ts Add sourcemaps to Next.js core compilation (#13049) 2020-05-19 09:09:59 +02:00
runtime-config.ts chore(next): export/lib/next-server missing types (#13320) 2020-05-24 22:44:05 +00:00
side-effect.tsx Remove Head.rewind as it's no longer needed (#14091) 2020-06-11 22:09:06 +00:00
utils.ts Clean up render.tsx options (#13759) 2020-06-06 23:00:03 +00:00