You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CpServiceProvider::boot() set the Inertia root view globally with Inertia::setRootView('statamic::layout'), so apps that render their own Inertia frontend outside the control panel inherited it and their pages (including Inertia error responses) rendered inside Statamic's CP layout. The control panel already sets its own root view via the HandleInertiaRequests middleware on every CP route, so the global call isn't needed and just leaks into the host app.
@jasonvarga mind reviewing this when you have a moment, it removes a redundant global Inertia root-view call that was leaking into host apps outside the CP.
Thanks for this — moving the rootView to HandleInertiaRequests is the right call.
One edge case: exception rendering for CP routes can happen before HandleInertiaRequests has run, so the root view wasn't always set yet — it fell back to Inertia's default (app) and crashed with View [app] not found.
Pushed a follow-up commit that pins ->rootView(...) explicitly in RendersControlPanelExceptions and RendersHttpExceptions, backed by a new HandleInertiaRequests::ROOT_VIEW constant. The RendersHttpExceptions one wasn't technically hitting the bug, but added it there too for consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CpServiceProvider::boot()set the Inertia root view globally withInertia::setRootView('statamic::layout'), so apps that render their own Inertia frontend outside the control panel inherited it and their pages (including Inertia error responses) rendered inside Statamic's CP layout. The control panel already sets its own root view via theHandleInertiaRequestsmiddleware on every CP route, so the global call isn't needed and just leaks into the host app.Fixes #14619