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

before_send_check_in breaks serialization when using php artisan optimize #893

Closed
InterstellarStella opened this issue May 7, 2024 · 4 comments

Comments

@InterstellarStella
Copy link

InterstellarStella commented May 7, 2024

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

4.4.1

Steps to reproduce

image
Then use php artisan optimize

Expected result

The process is completed without errors.

Actual result

We get the error LogicException: Your configuration files are not serializable..
This error isn't thrown if we don't optimize.

@stayallive
Copy link
Collaborator

See here on how to fix it: https://docs.sentry.io/platforms/php/guides/laravel/configuration/laravel-options/#closures-and-config-caching

@didac-adria
Copy link

Thank you guys. So I guess that by something like this should work:
image

image

Have in mind that we need to call back to the sentry config file within the NinjaSentryServiceProvider because env variables must be called within config files only.

@stayallive
Copy link
Collaborator

Yes, however you can't add any custom config options to your sentry.php config file since our SDK will not accept that so you would need to keep those settings elsewhere in your app.php config file or something or services.php.

@didac-adria
Copy link

That's right. This is the problem I've just faced. I was about to report that. That's a pitty, we should keep things organized.
I've moved it to another config file and works now.

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

No branches or pull requests

3 participants