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

Carbon 1.26.0 breaks Laravel compability #1250

Closed
alshenetsky opened this issue Apr 16, 2018 · 10 comments
Closed

Carbon 1.26.0 breaks Laravel compability #1250

alshenetsky opened this issue Apr 16, 2018 · 10 comments

Comments

@alshenetsky
Copy link

After composer update it says:

PHP Fatal error: Carbon\Carbon and Illuminate\Support\Traits\Macroable define the same property ($macros) in the composition of Illuminate\Support\Carbon. However, the definition differs and is considered incompatible.

Downgrade to 1.25.0 works fine

@Miguel-Serejo
Copy link

This is a Laravel issue, not a Carbon issue.

A quick glance at laravel's package.json shows a recent commit updated the dependency from "^1.24.1" to "1.25.*" which would fix this issue.

@kylekatarnls
Copy link
Collaborator

kylekatarnls commented Apr 16, 2018

Very unexpected, I just upgraded a Laravel project with no problem. What is your Laravel and PHP version?

Making $macros private could be a possible fix.

@Miguel-Serejo
Copy link

Laravel 5.6.16 requires nesbot/carbon at "^1.24.1" which does try to pull 1.26.0, which is grossly incompatibly with Laravel's Carbon extension.

Current fix is to manually restrict carbon to "1.25.*" or lower in any laravel projects.

@kylekatarnls
Copy link
Collaborator

kylekatarnls commented Apr 16, 2018

When did you get this error? on update, on run, on extend? I use Laravel 5.6 with Carbon 1.26 and PHP 7.2 just now and my macros work.

@Miguel-Serejo
Copy link

On updating an existing project. More specifically, on executing artisan package:discover to generate the autoload file.

@alshenetsky
Copy link
Author

alshenetsky commented Apr 16, 2018

This error throws in runtime also, not just in console. It breaks entire project.

So we are supposed to wait for new release of Laravel? I see they already fixed a dependency

@Miguel-Serejo
Copy link

I'd just like to ask that you refrain from tagging a new release reverting these changes before speaking with Taylor to prevent a repeat of the last time there was a Laravel/Carbon compatibility issue.

@kylekatarnls
Copy link
Collaborator

We will use an other variable name. But I still do not understand, I just ran artisan package:discover and composer create-project laravel/laravel with no problem at all.

@kylekatarnls
Copy link
Collaborator

@36864 @alshenetsky Can you try if installing dev-master version solves the problem?

@alshenetsky
Copy link
Author

Seems to be fixed. Thank you very much.

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

No branches or pull requests

3 participants