View [dashboard.index] not found
Hi Bobby,
Hope you're doing well! I have a head-scratching bug in production that I can't figure out quickly how to fix and I need it working in an hour.
The whole thing (laravel 9) works fine locally but when I pull from my production branch on to a fresh production server, it keeps throwing "View [dashboard.index]" not found.
It's been happening for the last two times that I've tried deploying it to production in the past week. First time, the automated deploys through github actions broke last week on Friday with that error. Now even on a fresh new AWS instance and manually pulling does the same thing.
Is it me who broke something last week somewhere in my code (works locally though but probably I ended up modifying a wrong (lib) file) or did something change in the wave repo?
Please help. It's urgent.
Thank you!
Hi there,
Where page exactly are you seeing that error on? No major changes have been made to Wave recently.
As far as I can see in the code, the only reference to the dashboard.index
view is in the wave/src/Http/Controllers/DashboardController.php
controller, have you made any changes to that file?
The dashboard index view should be in the following directory:
- For the Tall stack theme:
./resources/views/themes/tallstack/dashboard/index.blade.php
- For the Tailwind theme:
./resources/views/themes/tailwind/dashboard/index.blade.php
Can you verify if this file exists?
I've tested this with the latest changes from the main branch and it seems to be working as expected.
Hi Bobby,
Thank you for the quick response, and for checking it for me. All I remember was overriding wave routes for the dashboard in my App\Routes web.php file like this:
// Authentication routes
Auth::routes();
// Voyager Admin routes
Route::group(['prefix' => 'admin'], function () {
Voyager::routes();
});
// Override Voyager Routes
Route::middleware(['admin.user'])->prefix('admin')->group(function () {
Route::get('/', [VoyagerController::class, 'index'])->middleware('auth')->name('voyager.dashboard');
});
// Wave routes
Wave::routes();
And when I pushed the code to production and did php artisan route:cache
, it started throwing the "[dashboard.index] not found" error after the user logs into the the app and gets redirected to his dashboard.
It also throws the "Route [voyager.theme.index] not defined" error when accessing the /admin route.
If I clear the route cache, everything works fine.
Thank you for all the help!
Hi there,
The Route [voyager.theme.index] not defined
has been fixed with the latest changes to Wave, but you can manually apply the patch as described here:
Let me know if this also fixes the other route error that you are getting!