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

When using Composer to install, existing "package.js" is not updated, but on remove "package.js" is deleted. #411

Closed
hcoat opened this issue Oct 15, 2018 · 1 comment

Comments

@hcoat
Copy link

hcoat commented Oct 15, 2018

I have a recently upgraded Symfony 3 to 4 project in which I have been using yarn to manage my js dependencies.

I decided to try installing webpack-encore using the following commands:

 composer require symfony/webpack-encore-pack
 yarn install

I noticed my package.json was not altered and thought it might happen later, so I continued on.
I configured webpack.config.js and tried running

 yarn encore dev --watch

I got an error which I did not record at the time saying something to the effect that encore command could not be found.

I decided I wasn't ready to troubleshoot the problem and uninstalled with the following command:

 composer remove symfony/webpack-encore-pack

After which my pre-existing package.json had been removed.

I would expect the installation to give a warning or error if it cannot handle a pre-existing package.json.

Also I definitely do not think that it should be presumed that the package.json is there only because of webpack-encore and it should remain after webpack-encore has been removed.

Thanks

@hcoat hcoat changed the title When using Composer install existing "package.js" is not updated, but uninstall "package.js" is deleted. When using Composer to install, existing "package.js" is not updated, but on remove "package.js" is deleted. Oct 15, 2018
@Lyrkan
Copy link
Collaborator

Lyrkan commented Oct 15, 2018

Hi @hcoat,

You're not the first one to have that kind of issue, this is due to how the copy-from-recipe configurator of Flex works and that behavior is sadly the same for all files copied when you install a recipe.

I opened an issue on Flex's repository, feel free to add a comment if you have other suggestions on how both of these cases could be handled.

@Lyrkan Lyrkan closed this as completed Oct 15, 2018
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

2 participants