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

[Bug] Error when installing "form" package #26

Closed
javiereguiluz opened this issue Apr 4, 2017 · 9 comments
Closed

[Bug] Error when installing "form" package #26

javiereguiluz opened this issue Apr 4, 2017 · 9 comments
Labels

Comments

@javiereguiluz
Copy link
Member

In a fresh Symfony app, I install form without problems:

$ composer require form

Using version ^3.3@dev for symfony/form
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
  - Installing symfony/inflector (dev-master 3b19c08): Loading from cache
  - Installing symfony/property-access (dev-master 65b1197): Loading from cache
  - Installing symfony/options-resolver (dev-master 5edcb71): Loading from cache
  - Installing symfony/intl (dev-master dc7b5a5): Loading from cache
  - Installing symfony/polyfill-intl-icu (dev-master 2d6e2b2): Loading from cache
  - Installing symfony/form (dev-master 38a1f33): Downloading (100%)
Writing lock file
Generating autoload files
Executing script make cache-warmup [OK]
Skipping "assets:install --symlink --relative web" (needs symfony/console to run).

However, if I install cli afterwards, I see this error (I made no change in the app between the installation of "form" and "cli"):

$ composer req cli

Using version ^3.3@dev for symfony/console
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing symfony/console (dev-master 1030e32): Loading from cache
    Detected auto-configuration settings for "symfony/console"
    Setting configuration and copying files
Writing lock file
Generating autoload files
Executing script make cache-warmup [OK]
Executing script assets:install --symlink --relative %WEB_DIR% [KO]
 [KO]
Script assets:install --symlink --relative %WEB_DIR% returned with error code 1
!!
!!
!!    [Symfony\Component\DependencyInjection\Exception\LogicException]
!!    Form support cannot be enabled as the Translation component is not installe
!!    d.
!!
!!
!!
!!

Installation failed, reverting ./composer.json to its original content.
@stof
Copy link
Member

stof commented Apr 27, 2017

I don't think the issue is the installation of symfony/console.

The difference is that once symfony/console gets installed, the console command is running instead of being skipped, and so requires being able to boot the kernel without error.
Try booting the kernel after your first command, and you will see that it is the one being broken already (except that you never tried your project at that point)

@gnugat
Copy link

gnugat commented May 4, 2017

I tried to install a bundle that depends on Symfony Console, and got the same error. Here's how to reproduce the error:

# cd /tmp; rm -rf demo
composer create-project symfony/skeleton:3.3.x-dev demo
cd demo
composer require gnugat/micro-framework-bundle:^0.5

The output of the last command:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing symfony/console (dev-master 0f04702): Loading from cache
    Detected auto-configuration settings for "symfony/console"
    Setting configuration and copying files
  - Installing gnugat/micro-framework-bundle (v0.5.2): Loading from cache
    Detected auto-configuration settings for "gnugat/micro-framework-bundle"
    Enabling the package as a Symfony bundle
Writing lock file
Generating autoload files
Executing script make cache-warmup [OK]
Executing script assets:install --symlink --relative %WEB_DIR% [KO]
 [KO]
Script assets:install --symlink --relative %WEB_DIR% returned with error code 1
!!  
!!  
!!                                                                            
!!  
!!    [Symfony\Component\DependencyInjection\Exception\OutOfBoundsException]  
!!    Cannot replace arguments if none have been configured yet.              
!!  
!!                                                                            
!!  
!!  
!!  

Installation failed, reverting ./composer.json to its original content.

@gnugat
Copy link

gnugat commented May 4, 2017

🤔 actually, it looks like my error comes from the fact that %WEB_DIR% isn't set after creating the project.

@tarlepp
Copy link

tarlepp commented Jul 3, 2017

Hmm, personally got this after composer update command:

wunder@code-2017-VirtualBox:~/PhpstormProjects/symfony-flex-backend$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 21 updates, 0 removals
  - Removing symfony/flex (dev-master d4681b5)
  - Installing symfony/flex (dev-master d1c0b02): Downloading (100%)         
  - Removing symfony/stopwatch (3.4.x-dev 162ab93)
  - Installing symfony/stopwatch (3.4.x-dev 0a9eecc): Downloading (100%)         
  - Removing symfony/routing (dev-master e87f6e9)
  - Installing symfony/routing (dev-master a53262e): Downloading (100%)         
  - Removing symfony/debug (dev-master 2b1c9fd)
  - Installing symfony/debug (dev-master 78a5af2): Downloading (100%)         
  - Removing symfony/cache (dev-master 8b89866)
  - Installing symfony/cache (dev-master 42c3604): Downloading (100%)         
  - Removing symfony/doctrine-bridge (3.4.x-dev 6e8fd7f)
  - Installing symfony/doctrine-bridge (3.4.x-dev 4cdde1e): Downloading (100%)         
  - Removing symfony/property-access (dev-master ffd0b28)
  - Installing symfony/property-access (dev-master 0da9ebd): Downloading (100%)         
  - Removing symfony/security (dev-master a732f3f)
  - Installing symfony/security (dev-master 768b768): Downloading (100%)         
  - Removing symfony/intl (dev-master b4eeb6b)
  - Installing symfony/intl (dev-master ca86058): Downloading (100%)         
  - Removing symfony/process (dev-master 8bdb547)
  - Installing symfony/process (dev-master 3bce28b): Downloading (100%)         
  - Removing symfony/translation (dev-master 4d6d3dd)
  - Installing symfony/translation (dev-master a87e0cc): Downloading (100%)         
  - Removing phpunit/phpunit (dev-master 077a638)
  - Installing phpunit/phpunit (dev-master db5b7d5): Downloading (100%)         
  - Removing symfony/var-dumper (dev-master 060ff4d)
  - Installing symfony/var-dumper (dev-master 5633848): Downloading (100%)         
  - Removing symfony/console (3.4.x-dev 0353f8a)
  - Installing symfony/console (3.4.x-dev 1053791): Downloading (100%)         
  - Removing symfony/web-server-bundle (3.4.x-dev a4cdf82)
  - Installing symfony/web-server-bundle (3.4.x-dev ab38f26): Downloading (100%)         
  - Removing symfony/dotenv (3.4.x-dev cbd0766)
  - Installing symfony/dotenv (3.4.x-dev aaf1904): Downloading (100%)         
  - Removing symfony/twig-bundle (3.4.x-dev af0894b)
  - Installing symfony/twig-bundle (3.4.x-dev ae41aa0): Downloading (100%)         
  - Removing symfony/web-profiler-bundle (3.4.x-dev 64adcca)
  - Installing symfony/web-profiler-bundle (3.4.x-dev 47e8d1e): Downloading (100%)         
  - Removing symfony/validator (3.4.x-dev c314bcc)
  - Installing symfony/validator (3.4.x-dev 6406c11): Downloading (100%)         
  - Removing symfony/framework-bundle (3.4.x-dev edc62cf)
  - Installing symfony/framework-bundle (3.4.x-dev 607ceec): Downloading (100%)         
  - Removing symfony/yaml (3.4.x-dev f46d917)
  - Installing symfony/yaml (3.4.x-dev 519fb08): Downloading (100%)         
Writing lock file
Generating autoload files
Executing script make cache-warmup [OK]
Executing script assets:install --symlink --relative %WEB_DIR% [OK]
Executing script vendor/bin/security-checker security:check --end-point=http://security.sensiolabs.org/check_lock [OK]
Executing script %BIN_DIR%/check.php [OK]

wunder@code-2017-VirtualBox:~/PhpstormProjects/symfony-flex-backend$ 

And after that if I run composer update

wunder@code-2017-VirtualBox:~/PhpstormProjects/symfony-flex-backend$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Executing script make cache-warmup [OK]
Executing script assets:install --symlink --relative %WEB_DIR% [KO]
 [KO]
Script assets:install --symlink --relative %WEB_DIR% returned with error code 1
!!  
!!  
!!                                                      
!!  
!!    [InvalidArgumentException]                        
!!    The target directory "%WEB_DIR%" does not exist.  
!!  
!!                                                      
!!  
!!  
!!  assets:install [--symlink] [--relative] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<target>]
!!  
!!  
!!  
wunder@code-2017-VirtualBox:~/PhpstormProjects/symfony-flex-backend$

Any ideas?

@Pierstoval
Copy link
Contributor

%WEB_DIR% has just been replaced with %PUBLIC_DIR% thanks to #122 and other PRs, have you checked this var in your composer.json file ?

@tarlepp
Copy link

tarlepp commented Jul 4, 2017

@Pierstoval thanks, yeah that %WEB_DIR% has been changed to %PUBLIC_DIR% and web folder has been renamed to public. After I make those changes manually all started to working again.

@chapterjason
Copy link

chapterjason commented Sep 17, 2017

After composer req form I've got two errors on the automated script execution make cache-clear that The Translation component is required to use the Form component. and after that The Validator component is required to use the Form component.

@sstok
Copy link

sstok commented Sep 18, 2017

The Form component itself can work perfect without the validator and translator (which for Form is only required for validation). But when using the Form component with the FrameworkBundle there are additional requirements.

Eg. the FrameworkBundle needs to detect if these other components are installed (and otherwise disable there integration with the Form component). Or we need a form-pack to install the additional requirements for this Flex case.

@fabpot
Copy link
Member

fabpot commented Sep 24, 2017

Better experience on Symfony 3.4 now thanks to symfony/symfony#24303

@fabpot fabpot closed this as completed Sep 24, 2017
fabpot added a commit to symfony/symfony that referenced this issue Sep 24, 2017
… validator (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] allow forms without translations and validator

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/flex#26, symfony/recipes#191, symfony/recipes#193
| License       | MIT
| Doc PR        |

The Form component is perfectly usable without the Translation and Validator components. We should allow the same when using the FrameworkBundle to improve the user experience in Symfony Flex applications (see the linked issue).

Commits
-------

cb6ead1 allow forms without translations and validator
tgalopin pushed a commit to tgalopin/flex that referenced this issue Dec 3, 2020
This PR was merged into the master branch.

Discussion
----------

added symfony/orm-pack

Commits
-------

2b44c26 added symfony/orm-pack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants