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

Illuminate/Support package does not declare Laravel/SerializeClosure as a Dependency #52670

Closed
craigrileyuk opened this issue Sep 6, 2024 · 4 comments · Fixed by #52673
Closed

Comments

@craigrileyuk
Copy link

Laravel Version

11.22

PHP Version

8.3

Database Driver & Version

No response

Description

I use some Illuminate packages without the Laravel/Framework package in a project and I've started getting errors for "Error: Class "Laravel\SerializableClosure\Support\ReflectionClosure" not found in file /path/to/project/vendor/illuminate/support/Onceable.php on line 66"

Checking the dependency list for the Support package in composer.json, I can't see "laravel/serializable-closure" package listed there which is causing the error when it's not listed elsewhere (i.e. in the main laravel/framework package where it is listed).

Steps To Reproduce

Install 'Illuminate/Support' by itself and use a function that calls the "Onceable" class.

@driesvints
Copy link
Member

Thanks for reporting this. I sent in a PR to add this to the package's suggest list: #52673

@winds1983
Copy link

winds1983 commented Nov 2, 2024

I get same error:
PHP Fatal error: Uncaught Error: Class "Laravel\SerializableClosure\Support\ReflectionClosure" not found in vendor/illuminate/support/Onceable.php:66
You can install laravel/serializable-closure package to fix this issue:
composer require laravel/serializable-closure

@CoderJoeW
Copy link

I also am experiencing the same issue after upgrading to 11.33.2

@onlime
Copy link
Contributor

onlime commented Dec 4, 2024

@CoderJoeW

I also am experiencing the same issue after upgrading to 11.33.2

so you probably did not study this thread thoroughly. For clarification: PR #52673 did not fix this "automagically", it has just added laravel/serializable-closure to the suggested packages. So, if you are using illuminate/support independently (outside of a Laravel project), you still need add this:

$ composer require laravel/serializable-closure

tested in an ancient ZF1 project which uses once() helper with latest illuminate/support v11.43.2

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.

5 participants