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

artisan route:cache Unable to prepare route [api/v1] for serialization. Uses Closure. #10224

Closed
2 tasks done
wenjy opened this issue Oct 26, 2021 · 6 comments · Fixed by #15082
Closed
2 tasks done

artisan route:cache Unable to prepare route [api/v1] for serialization. Uses Closure. #10224

wenjy opened this issue Oct 26, 2021 · 6 comments · Fixed by #15082

Comments

@wenjy
Copy link

wenjy commented Oct 26, 2021

Debug mode

Describe the bug

Unable to prepare route [api/v1] for serialization. Uses Closure.

Reproduction steps

  1. composer install --no-dev
  2. php artisan optimize

Expected behavior

successfully

Screenshots

No response

Snipe-IT Version

5.3.0

Operating System

Centos7

Web Server

nginx

PHP Version

7.4.24

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

@welcome
Copy link

welcome bot commented Oct 26, 2021

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@snipe
Copy link
Owner

snipe commented Oct 26, 2021

You don't need to cache the routes. You can skip php artisan optimize for now

@wenjy
Copy link
Author

wenjy commented Oct 26, 2021

OK Thanks

@wenjy wenjy closed this as completed Oct 26, 2021
@snipe snipe reopened this Oct 26, 2021
@snipe
Copy link
Owner

snipe commented Oct 26, 2021

Reopening this, since it is a legitimate bug, just not one that breaks anything.

@inietov
Copy link
Collaborator

inietov commented Oct 26, 2021

I'm sorry, I think this can't be fixed without rewriting all of our existing routes. The Laravel documentation warns that this is not possible with routes using closures https://laravel.com/docs/6.x/deployment#optimizing-route-loading:
image

which we use extensively. So, unfortunately, I don't think we can address this issue in short term...

@snipe
Copy link
Owner

snipe commented Feb 13, 2023

FYI, this is related to #11595, where we had done a lot of fixes. In Laravel 8, the closure isn't the issue anymore, but rather duplicate names for routes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants