PolyPlanker's avatar

Fresh Nova Install Resulting in 404

Hello,

I recently purchased Nova and installed it per the Nova documentation and when I attempt to visit mysite.com/nova I get a 404 not found (obviously replacing mysite.com with my URL). I can however see the default Laravel welcome page at the root URL.

Laravel - 8.15.0 PHP - 7.4.9 Nova - 3.15.0 WAMP - 3.3.3

The migrations ran successfully, I've installed nova, published the nova resources, manually added the Nova Provider in my app config (although I don't believe thats required with auto-discover), tried running "php artisan config:cache" and added a user through the Nova CLI, all with no luck.

Note, I see it also installed the laravel/ui package which I have not installed (literally a fresh copy of Laravel only following the Nova docs) but I dont think that would have any effect.

Any help is greatly appreciated.

0 likes
15 replies
bugsysha's avatar

Check the routes. Check log files. To me it does not provide any value saying "tried running php artisan config:cache and added a user through the Nova CLI, all with no luck". What was the error? Did error occur?

PolyPlanker's avatar

No errors occurred while installing, everything ran as expected. I'm getting a 404 Not Found error when accessing Nova through the browser. No errors logged, there are also no routes for Nova listed in my routes file but Laravel Spark installs the same way without adding routes to the routes file so I assumed that was not the issue.

When I run "php artisan route:list" I see all the Nova API routes but no "frontend" routes (IE "/nova") as stated.

RealMiel's avatar

Hey, have you found a solution to this issue? I keep getting a 404 error

PolyPlanker's avatar

Unfortunately I have not. I assumed I was the only one having the issue and was ready to write off my $99 purchase.

crynobone's avatar

When I run "php artisan route:list" I see all the Nova API routes but no "frontend" routes (IE "/nova") as stated.

This should be the default routes

php artisan route:list --columns=uri
+--------------------------------------------------------------------------------------------+
| URI                                                                                        |
+--------------------------------------------------------------------------------------------+
| /                                                                                          |
| api/user                                                                                   |
| nova                                                                                       |
| nova-api/cards                                                                             |
| nova-api/dashboards/cards/{dashboard}                                                      |
| nova-api/dashboards/{dashboard}                                                            |
| nova-api/metrics                                                                           |
| nova-api/metrics/{metric}                                                                  |
| nova-api/scripts/{script}                                                                  |
| nova-api/search                                                                            |
| nova-api/styles/{style}                                                                    |
| nova-api/{resource}                                                                        |
| nova-api/{resource}                                                                        |
| nova-api/{resource}                                                                        |
| nova-api/{resource}/action                                                                 |
| nova-api/{resource}/actions                                                                |
| nova-api/{resource}/associatable/{field}                                                   |
| nova-api/{resource}/cards                                                                  |
| nova-api/{resource}/count                                                                  |
| nova-api/{resource}/creation-fields                                                        |
| nova-api/{resource}/detach                                                                 |
| nova-api/{resource}/field/{field}                                                          |
| nova-api/{resource}/filters                                                                |
| nova-api/{resource}/force                                                                  |
| nova-api/{resource}/lens/{lens}                                                            |
| nova-api/{resource}/lens/{lens}                                                            |
| nova-api/{resource}/lens/{lens}/action                                                     |
| nova-api/{resource}/lens/{lens}/actions                                                    |
| nova-api/{resource}/lens/{lens}/cards                                                      |
| nova-api/{resource}/lens/{lens}/count                                                      |
| nova-api/{resource}/lens/{lens}/filters                                                    |
| nova-api/{resource}/lens/{lens}/force                                                      |
| nova-api/{resource}/lens/{lens}/metrics                                                    |
| nova-api/{resource}/lens/{lens}/metrics/{metric}                                           |
| nova-api/{resource}/lens/{lens}/restore                                                    |
| nova-api/{resource}/lenses                                                                 |
| nova-api/{resource}/metrics                                                                |
| nova-api/{resource}/metrics/{metric}                                                       |
| nova-api/{resource}/morphable/{field}                                                      |
| nova-api/{resource}/relate-authorization                                                   |
| nova-api/{resource}/restore                                                                |
| nova-api/{resource}/soft-deletes                                                           |
| nova-api/{resource}/trix-attachment/{field}                                                |
| nova-api/{resource}/trix-attachment/{field}                                                |
| nova-api/{resource}/trix-attachment/{field}/{draftId}                                      |
| nova-api/{resource}/{resourceId}                                                           |
| nova-api/{resource}/{resourceId}                                                           |
| nova-api/{resource}/{resourceId}/attach-morphed/{relatedResource}                          |
| nova-api/{resource}/{resourceId}/attach/{relatedResource}                                  |
| nova-api/{resource}/{resourceId}/attachable/{field}                                        |
| nova-api/{resource}/{resourceId}/creation-pivot-fields/{relatedResource}                   |
| nova-api/{resource}/{resourceId}/download/{field}                                          |
| nova-api/{resource}/{resourceId}/field/{field}                                             |
| nova-api/{resource}/{resourceId}/metrics/{metric}                                          |
| nova-api/{resource}/{resourceId}/update-attached/{relatedResource}/{relatedResourceId}     |
| nova-api/{resource}/{resourceId}/update-fields                                             |
| nova-api/{resource}/{resourceId}/update-pivot-fields/{relatedResource}/{relatedResourceId} |
| nova-api/{resource}/{resourceId}/{relatedResource}/{relatedResourceId}/field/{field}       |
| nova/login                                                                                 |
| nova/login                                                                                 |
| nova/logout                                                                                |
| nova/password/email                                                                        |
| nova/password/reset                                                                        |
| nova/password/reset                                                                        |
| nova/password/reset/{token}                                                                |
| nova/{view}                                                                                |
+--------------------------------------------------------------------------------------------+

Can you verify config/app.php contain the following App\Provider\NovaServiceProvider::class, added to providers

1 like
Maria30's avatar

@polyplanker the same here

I just created a route until i create a policy

  Route::get('/nova', function ()
{
    redirect('http://localhost:8888/nova/dashboards/main');
})->middleware('auth');
}
RayC's avatar

You can fix this error by adding the Nova Service Provider to your service providers. For some reason it does not add it automatically.

Add following to aconfig/pp.php

App\Providers\NovaServiceProvider::class,

Run this after

composer dump-autoload
1 like
patrikgrinsvall's avatar

its think its like this, writing from memory here:

NOVA_PATH=/nova // if this starts with a slash, then in some views on some hosts are interpreted as // which means same host but no port number, eg. //localhost/nova, so the result of this is in routes list you can see localhost/nova, the full url but without port. If configured correct nova routes should not contain hostname by default. NOVA_DOMAIN // also a tricky one if not correct, if its not left to default, you must likley debug alot

or

ASSET_PATH=/ // if you only have asset path then same as above can happen on some circumstances, so the assets for nova doesnt work properly because of missing port number

So, in general it seems laravel route, paths in configs etc. Should never start with a slash. Except in telescope! But that is another discussion

Concept24's avatar

Same here.. With a fresh install of laravel nova 4, after login i get 404 error page "nova/dashboards/main"

By adding the "App\Providers\NovaServiceProvider::class" + composer dump-autoload not works for me

2 likes
MartinVandersteen's avatar

Hello !

Had this problem too after updating to v4 from v3. Done all of the above + upgrade guide. It turns out the when using 'php artisan nova:dashboard Main', it doesn't automatically register the dashboard in the provider.

Basically you just need to add "new Main," in the return value of the "dashboards" function in your NovaServiceProvider

See the docs for more details (can't post link as I signed up to post this): nova dot laravel dot com/docs/4.0/customization/dashboards.html#registering-dashboards

14 likes
pjstew's avatar

@MartinVandersteen Thanks for that! It wasn't clear in the migration guide, and other similar resolved issues were not working for me. Many thanks for sharing!! 🚀

belief-man's avatar

Perhaps you can try to set up pseudo-static rules. Just select the Laravel universal option. Maybe it's just a minor issue and thus gets overlooked.

Please or to participate in this conversation.