Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with cached routes #25

Open
alex-osborn opened this issue Mar 12, 2019 · 8 comments
Open

Conflict with cached routes #25

alex-osborn opened this issue Mar 12, 2019 · 8 comments
Labels
bug Something isn't working

Comments

@alex-osborn
Copy link

The Nova Pages tool doesn't load correctly when routes are cached with php artisan route:cache.

Steps to reproduce:

  1. Load Nova, navigate to Pages tool. The tool load correctly.
  2. Run php artisan route:cache.
  3. Reload the tool. The tool does not load correctly.
  4. Clear cached routes with php artisan route:clear.
  5. Reload the tool. The tool loads correctly again.

From my debugging, appears as if the original Nova routes are used when caching is enabled which is giving a dependency injection error.

Screen Shot 2019-03-13 at 12 11 07 PM

@voidgraphics voidgraphics added the bug Something isn't working label Mar 13, 2019
@raphcollective
Copy link
Contributor

raphcollective commented Mar 15, 2019

Hey, I tried to do some exploration on the issue.

I discovered than when the routes are cached they don't seem to show up in the Route::getRoutes()->getRoutes() array in the registerRouteTemplates function of the TemplatesRepository. Actually only the nova routes show up in there. They do appear correctly in route:list and in tinker when I call the function manually. I couldn't really figure out why but I hope this helps.

I'm using a fresh Laravel 5.8 project with Nova 2, this is how the route is registered:
Route::get('/home', 'PageController@index')->template(\App\Nova\Templates\Test::class)->name('home');

@slavarazum
Copy link

Catch the same issue, have any ideas how to fix it? Don't want to lose ability of route caching 😕

@Arkenis
Copy link

Arkenis commented Aug 19, 2019

+1

still having those issues with Laravel Nova 2.0.11 + nova-page 0.2.3

@shalawani
Copy link
Contributor

Any idea to solve this issue guys, please

@chrispage1
Copy link

Just hit this issue myself when deploying this with a project using deployer. It breaks a lot of stuff!

I've even tried limiting down my routes file so it doesn't leverage the middleware, and doesn't define a template but still no joy...

@thinkspill
Copy link

Hit this issue on a new (nova 2.7) project just now.

@gwleuverink
Copy link

@voidgraphics The issue still exists with L6.14.0 and Nova 2.10.1

@nickbluestone98
Copy link

nickbluestone98 commented Jan 28, 2022

Is there any fix for this yet @voidgraphics ? Really seems a shame to not get this bug fixed. Have the exact same issues as above in Laravel 8 and Nova 3. The package itself is fantastic and super useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants