next.js
56a6c864 - Turbopack: ensure default layout is provided in default not-found entrypoint (#76912)

Commit
357 days ago
Turbopack: ensure default layout is provided in default not-found entrypoint (#76912) When Turbopack creates the default not-found entry, it does so without providing a default root layout in case one is missing. This works ok in Webpack since the `default-layout` is correctly added in [next-app-loader](https://github.com/vercel/next.js/blob/4518bc91641a0fd938664b781e12ae7c145f3396/packages/next/src/build/webpack/loaders/next-app-loader/index.ts#L339-L342). Looking at the [original PR](https://github.com/vercel/next.js/pull/54199) that added `default-layout` it seems it was only really ever intended for the not-found entrypoint since in all other cases, a missing root layout means we create one for you in dev and in build it'd be a hard error. This also includes the other defaults that are correctly added in other entries to match Webpack behavior. Though I'm not sure the presence of these makes a difference when rendering the not found page Closes NDX-858
Author
Parents
Loading