This was a bit fiddly to reproduce. But my issue is basically the following:
- A route
routes/bar.tsx has skipAppWrapper: true and skipInheritedLayouts: true
- A route
routes/foo.tsx has no config set
- A route
routes/index.tsx has no config set
- There is a
_app.tsx and _500.tsx in routes/
- The path
/foo is rendered without the _app.tsx wrapper
I came upon this bug when I has a route in my app inside routes/api/cart which was intended to return partials, and thus did not need _app or _layout. Instead though, this caused all routes except / to no longer get the app wrapper.
If I removed the config from _500.tsx, or removed the _500.tsx, I could no longer reproduce the issue. So I could not manage to make the reproduction any smaller than this.
PR with failing unit test
I managed to create a unit test that fails with the same issue in #2911.
Reproduction
The issue was a bit fiddly to reproduce, as it seems to depend on the order in which routes are read. /index.tsx is rendered correctly (has App wrapper), but the /foo.tsx route does not even though it should. I haven't found the solution to this, but it looks to me that whether an app-wrapper exists or not can be permanently set to false for a certain order of route handling.
// _500.tsx
export const config = {
skipInheritedLayouts: true
};
export default () => {
return <h2>500 error</h2>;
};
// _app.tsx
export default (({ Component }) => {
return <>app/<Component /></>;
};
// bar.tsx
export const config = {
skipAppWrapper: true,
skipInheritedLayouts: true
};
export default () => {
return <>bar</>;
};
// foo.tsx
export default () => {
return <>foo</>;
};
// index.tsx
export default () => {
return <>index</>;
};
Expected result
Route /foo has an app wrapper.
Actual result
Route /foo does not have ean app wrapper.
This was a bit fiddly to reproduce. But my issue is basically the following:
routes/bar.tsxhasskipAppWrapper: trueandskipInheritedLayouts: trueroutes/foo.tsxhas noconfigsetroutes/index.tsxhas noconfigset_app.tsxand_500.tsxinroutes//foois rendered without the_app.tsxwrapperI came upon this bug when I has a route in my app inside
routes/api/cartwhich was intended to return partials, and thus did not need_appor_layout. Instead though, this caused all routes except/to no longer get the app wrapper.If I removed the config from
_500.tsx, or removed the_500.tsx, I could no longer reproduce the issue. So I could not manage to make the reproduction any smaller than this.PR with failing unit test
I managed to create a unit test that fails with the same issue in #2911.
Reproduction
The issue was a bit fiddly to reproduce, as it seems to depend on the order in which routes are read.
/index.tsxis rendered correctly (has App wrapper), but the/foo.tsxroute does not even though it should. I haven't found the solution to this, but it looks to me that whether an app-wrapper exists or not can be permanently set tofalsefor a certain order of route handling.Expected result
Route
/foohas an app wrapper.Actual result
Route
/foodoes not have ean app wrapper.