Sylius: Dependency conflicts with SyliusResourceBundle
Hi everyone,
I’m trying to create a Symfony 3.2 project from scratch (not e-commerce) with SyliusResourceBundle in order to have CRUD support out of the box for my entities. I didn’t manage to install the bundle because of composer conflicts:
$ composer require sylius/resource-bundle
Using version ^0.19.0 for sylius/resource-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sylius/resource-bundle ^0.19.0 -> satisfiable by sylius/resource-bundle[v0.19.0].
- Conclusion: remove symfony/symfony 3.2.x-dev
- Conclusion: don't install symfony/symfony 3.2.x-dev
- sylius/resource-bundle v0.19.0 requires symfony/validator ^2.8 -> satisfiable by symfony/validator[2.8.x-dev, v2.8.0, v2.8.0-BETA1, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.2, v2.8.3, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].
- don't install symfony/validator 2.8.x-dev|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.0|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.0-BETA1|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.1|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.10|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.11|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.12|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.13|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.14|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.2|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.3|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.4|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.5|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.6|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.7|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.8|don't install symfony/symfony 3.2.x-dev
- don't install symfony/validator v2.8.9|don't install symfony/symfony 3.2.x-dev
- Installation request for symfony/symfony (locked at 3.2.x-dev, required as 3.2.*) -> satisfiable by symfony/symfony[3.2.x-dev].
Installation failed, reverting ./composer.json to its original content.
Then I updated my composer.json to set minimum-stability to dev and tried this:
$ composer require sylius/resource-bundle dev-master
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sylius/resource-bundle dev-master -> satisfiable by sylius/resource-bundle[dev-master].
- Conclusion: remove sensio/framework-extra-bundle v3.0.16
- Conclusion: don't install sensio/framework-extra-bundle v3.0.16
- sylius/resource-bundle dev-master requires friendsofsymfony/rest-bundle ^1.8 -> satisfiable by friendsofsymfony/rest-bundle[1.8.0, 1.8.0-BETA1, 1.8.0-BETA2, 1.8.x-dev].
- friendsofsymfony/rest-bundle 1.8.0 conflicts with sensio/framework-extra-bundle[v3.0.16].
- friendsofsymfony/rest-bundle 1.8.0-BETA1 conflicts with sensio/framework-extra-bundle[v3.0.16].
- friendsofsymfony/rest-bundle 1.8.0-BETA2 conflicts with sensio/framework-extra-bundle[v3.0.16].
- friendsofsymfony/rest-bundle 1.8.x-dev conflicts with sensio/framework-extra-bundle[v3.0.16].
- Installation request for sensio/framework-extra-bundle (locked at v3.0.16, required as ^3.0.2) -> satisfiable by sensio/framework-extra-bundle[v3.0.16].
Installation failed, reverting ./composer.json to its original content.
I even tried to downgrade to Symfony 3.1 then Symfony 3.0 (fresh installs each time), but I still have composer issues. What is your advice?
Thank you in advance, Ben
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (15 by maintainers)
Hi there again,
Now that I succeeded in installing SyliusResourceBundle with Symfony 3.2, I’m following the tutorial in the documentation, but it still doesn’t work out of the box: http://docs.sylius.org/en/latest/bundles/SyliusResourceBundle/configuration.html
Translator issue
I have registered the /books endpoint as an api resource:
Now when I call
GET http://localhost:8000/books, an exception is raised:Indeed, with a fresh Symfony install, the following line in
config.ymlis commented by default:As a result, the
translatorservice maps toSymfony\Component\Translation\IdentityTranslatorclass, which does not translate anything, and is not instanceofSymfony\Component\Translation\TranslatorBagInterface.Uncommenting that line maps the
translatorservice toSymfony\Component\Translation\DataCollectorTranslatorwhich solves the problem.I don’t know if this is a bug, or if enabling the translation component is mandatory for the bundle to work. In that case, you should mention this in the doc.
Content-negociation issue
Then, when calling
GET http://localhost:8000/bookswith anAccept: application/jsonheader, the following exception is raised:Since I requested a JSON response, why looking for a template? In fact, FOSRestBundle needs to be configured, I didn’t figure that out at the first glance. Maybe mentionning this in the doc would help newbies like me 😃
First resource creation issue
Now that I have a JSON response on the index, I’d like to create my first book, as told in the tutorial.
Here’s the result:
Do I need to create a form for my Book example? I thought form generation was automatic since the bundle has an option to use a “custom” form.
Sorry for bothering you, I’m not even certain this is the right place to ask for help, but I noticed you put big efforts in the documentation to make things easy and the DX perfect, so I’d like to contribute to that 😉
Thanks, Ben
@lchrusciel is on it right now! 😃
@venyii, that works! Excellent. I’m going through and trying to update the documentation as I find deficiencies and ambiguities, so this should help a bunch. I hope this also helped @bpolaszek with his issue?
Oh, you. ❤️
@baublet Yes, that is the case since the recent Symfony 3 upgrade.
formshould be a class now, like in https://github.com/Sylius/Sylius/pull/6878/files#diff-476eba1ccbee1d4df669cd3452bdd165R20Try using
^1.0@betain your composer.json. Orcomposer require -s beta sylius/resource-bundle.@TheMadeleine We should use stability beta in all bundle documentations. Can you do a quick fix please?