whitecube / nova-page

Static pages content management for Laravel Nova
https://whitecube.github.io/nova-page
MIT License
238 stars 41 forks source link

Not working with Route:cache #64

Open Jaspur opened 4 years ago

Jaspur commented 4 years ago

When php artisan route:cache ran, it's not working:

[2020-05-19 16:22:37] production.ERROR: Argument 1 passed to Whitecube\NovaPage\Pages\StaticResource::__construct() must be an instance of Whitecube\NovaPage\Pages\Template, instance of Whitecube\NovaPage\Pages\Manager given, called in /home/forge/foobar.nl/vendor/laravel/nova/src/Http/Requests/InteractsWithResources.php on line 65 {"userId":1,"exception":"[object] (TypeError(code: 0): Argument 1 passed to Whitecube\\NovaPage\\Pages\\StaticResource::__construct() must be an instance of Whitecube\\NovaPage\\Pages\\Template, instance of Whitecube\\NovaPage\\Pages\\Manager given, called in /home/forge/foobar.nl/vendor/laravel/nova/src/Http/Requests/InteractsWithResources.php on line 65 at /home/forge/foobar.nl/vendor/whitecube/nova-page/src/Pages/StaticResource.php:52)
[stacktrace]

@Nyratas

CaddyDz commented 4 years ago

Having the same issue

Whitecube\NovaPage\Exceptions\TemplateNotFoundException NovaPage Template for "route.about" not found.

CaddyDz commented 4 years ago

Issue exists since #25

CaddyDz commented 4 years ago

Looking at the cached routes in bootstrap/cache/routes-v7.php I found this

'/about' => 
array (
0 => 
array (
    0 => 
    array (
    '_route' => 'about',
    ),
),
),
'/explanations' => 
array (
0 => 
array (
    0 => 
    array (
    '_route' => 'generated::IiVW6TNc537ZRvuv',
    ),
),

The _route array key should have a generate value, instead it's just the route name

simonfunk commented 3 years ago

I have the same issue, is there a fix?

keizah7 commented 2 years ago

I have this issue with route caching

[2022-01-03 10:33:17] local.ERROR: Whitecube\NovaPage\Pages\StaticResource::__construct(): Argument #1 ($resource) must be of type Whitecube\NovaPage\Pages\Template, Whitecube\NovaPage\Pages\Manager given, called in /Users/arturas/code/Freelance/jammi/nova/src/Http/Requests/InteractsWithResources.php on line 65 {"userId":9,"exception":"[object] (TypeError(code: 0): Whitecube\\NovaPage\\Pages\\StaticResource::__construct(): Argument #1 ($resource) must be of type Whitecube\\NovaPage\\Pages\\Template, Whitecube\\NovaPage\\Pages\\Manager given, called in /Users/arturas/code/Freelance/jammi/nova/src/Http/Requests/InteractsWithResources.php on line 65 at /Users/arturas/code/Freelance/jammi/vendor/whitecube/nova-page/src/Pages/StaticResource.php:52)
[stacktrace]
#0 /Users/arturas/code/Freelance/jammi/nova/src/Http/Requests/InteractsWithResources.php(65): Whitecube\\NovaPage\\Pages\\StaticResource->__construct(Object(Whitecube\\NovaPage\\Pages\\Manager))
arhitektorr commented 2 years ago

I got the same problem. Why don't the creators fix this problem? You have found a solution. By clearing the cache of the mof router, the problem does not disappear 444

voidgraphics commented 2 years ago

@Sliper959595 If you have a solution, please send a pull request.

arhitektorr commented 2 years ago

The thing is, I don't have a solution. I need it myself. How can I solve this problem. Will you release an update or how do I work around this error?

ср, 10 авг. 2022 г. в 12:11, Adrien Leloup @.***>:

@Sliper959595 https://github.com/Sliper959595 If you have a solution, please send a pull request.

— Reply to this email directly, view it on GitHub https://github.com/whitecube/nova-page/issues/64#issuecomment-1210388267, or unsubscribe https://github.com/notifications/unsubscribe-auth/APECO76TMOSES32QGZYK4PTVYNW35ANCNFSM4NFBU4CA . You are receiving this because you were mentioned.Message ID: @.***>

voidgraphics commented 2 years ago

@Sliper959595 there is no known solution to this problem at this time, except not using route caching. If you do find a solution or workaround, please consider sharing your findings with others in this thread, or better yet, opening a pull request with a fix. Thanks

arhitektorr commented 1 year ago

How do I disable caching in laravel? when I reset all caches it still doesn't work. Please tell me how I can refuse caching

ср, 10 авг. 2022 г. в 12:54, Adrien Leloup @.***>:

@Sliper959595 https://github.com/Sliper959595 there is no known solution for this problem at this time, except not using route caching. If you do find a solution or workaround, please consider sharing your findings with others in this thread, or better yet, opening a pull request with a fix. Thanks

— Reply to this email directly, view it on GitHub https://github.com/whitecube/nova-page/issues/64#issuecomment-1210439409, or unsubscribe https://github.com/notifications/unsubscribe-auth/APECO7ZXZ46APSFCF3OA5ITVYN36VANCNFSM4NFBU4CA . You are receiving this because you were mentioned.Message ID: @.***>

jahvi commented 1 year ago

As a workaround avoid caching routes for now, not ideal but at least it works.

aurelien-ci commented 11 months ago

I have the same issue

jolora commented 8 months ago

Curious if anyone has any idea about how to provide a longer term fix for this please? I'd like to apply route caching on my application but doing so breaks this package.

toonvandenbos commented 3 months ago

Hello there, sorry for the delay.

I published a fix that should have fixed this issue... At least, everything seems to be working fine on my local testing app. Could you please confirm? Thanks!