webpack-bundle icon indicating copy to clipboard operation
webpack-bundle copied to clipboard

maba:webpack:compile --env=prod doesn´t work

Open asiermarques opened this issue 7 years ago • 4 comments

Running the command

php bin/console maba:webpack:compile --env=prod

results in

[Symfony\Component\Console\Exception\CommandNotFoundException]  There are no commands defined in the "maba:webpack" namespace.

Seems like maba:webpack:compile doesn´t accept any params

asiermarques avatar Mar 10 '17 18:03 asiermarques

Did you register MabaWebpackBundle inside AppKernel? Maybe it's in dev environment if block?

mariusbalcytis avatar Mar 10 '17 20:03 mariusbalcytis

Yes, in fact the php bin/console maba:webpack:compile command, without the env param, works fine.

asiermarques avatar Mar 10 '17 20:03 asiermarques

If it's working in dev environment (which is default if you do not pass --env) and not in prod, I would suggest to:

  • check if bundle is configured to be used in production environment (see AppKernel). It must be outside of if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
  • clear var/cache/prod just to be sure that it's not cache-related somehow

In any way, I cannot see how this could be related to the bundle itself and not to the configuration of it in your current set-up.

mariusbalcytis avatar Mar 10 '17 22:03 mariusbalcytis

Just had a similar problem after updating from a 0.5.x version. Even console cache:clear failed trying to access DynamicAssetProvider class, which presumably no longer exists. Manually removing var/cache/prod fixed it.

b4cedev avatar Mar 16 '17 10:03 b4cedev