Problem/Motivation

Have this running on my local (Windows, PHP 7.4) but when migrating to server (centos, php7.4) the site is dead. When i try to run drush cr i get:

 [error]  ParseError: syntax error, unexpected ')' in Composer\Autoload\includeFile() (line 146 of /home/nzenzen/public_html/staging/web/modules/contrib/charts/src/Plugin/views/style/ChartsPluginStyleChart.php) #0 /home/nzenzen/public_html/staging/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/home/nzenzen/p...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\charts\\P...')
#2 [internal function]: spl_autoload_call('Drupal\\charts\\P...')
#3 /home/nzenzen/public_html/staging/web/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php(96): class_exists('Drupal\\charts\\P...')
#4 /home/nzenzen/public_html/staging/web/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(17): Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass('chart', Array, 'Drupal\\views\\Pl...')
#5 /home/nzenzen/public_html/staging/web/core/lib/Drupal/Component/Plugin/PluginManagerBase.php(83): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('chart', Array)
#6 /home/nzenzen/public_html/staging/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(817): Drupal\Component\Plugin\PluginManagerBase->createInstance('chart')
#7 /home/nzenzen/public_html/staging/web/core/modules/views/src/ViewExecutable.php(891): Drupal\views\Plugin\views\display\DisplayPluginBase->getPlugin('style')
#8 /home/nzenzen/public_html/staging/web/core/modules/views/src/ViewExecutable.php(871): Drupal\views\ViewExecutable->initStyle()
#9 /home/nzenzen/public_html/staging/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(434): Drupal\views\ViewExecutable->getStyle()
#10 /home/nzenzen/public_html/staging/web/core/modules/views/src/Plugin/views/field/NumericField.php(27): Drupal\views\Plugin\views\field\FieldPluginBase->defineOptions()
#11 /home/nzenzen/public_html/staging/web/core/modules/views/src/Plugin/views/PluginBase.php(139): Drupal\views\Plugin\views\field\NumericField->defineOptions()
#12 /home/nzenzen/public_html/staging/web/core/modules/views/src/Plugin/views/HandlerBase.php(102): Drupal\views\Plugin\views\PluginBase->init(Object(Drupal\views\ViewExecutable), Object(Drupal\views\Plugin\views\display\DefaultDisplay), Array)
#13 /home/nzenzen/public_html/staging/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(117): Drupal\views\Plugin\views\HandlerBase->init(Object(Drupal\views\ViewExecutable), Object(Drupal\views\Plugin\views\display\DefaultDisplay), Array)
#14 /home/nzenzen/public_html/staging/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(895): Drupal\views\Plugin\views\field\FieldPluginBase->init(Object(Drupal\views\ViewExecutable), Object(Drupal\views\Plugin\views\display\DefaultDisplay), Array)
#15 /home/nzenzen/public_html/staging/web/core/modules/views/src/Entity/View.php(553): Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('field')
#16 /home/nzenzen/public_html/staging/web/core/lib/Drupal/Core/Config/ConfigManager.php(494): Drupal\views\Entity\View->onDependencyRemoval(Array)
#17 /home/nzenzen/public_html/staging/web/core/lib/Drupal/Core/Config/ConfigManager.php(357): Drupal\Core\Config\ConfigManager->callOnDependencyRemoval(Object(Drupal\views\Entity\View), Array, 'module', Array)
#18 /home/nzenzen/public_html/staging/web/core/lib/Drupal/Core/Config/ConfigManager.php(218): Drupal\Core\Config\ConfigManager->getConfigEntitiesToChangeOnDependencyRemoval('module', Array, false)

Cant do anything now. Cant disable the module with drush.

This was originally with 5-alpha3 but saw someone report similar error and it says fixed in -dev, so switched to dev but no luck.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork charts-3273410

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

liquidcms created an issue. See original summary.

andileco’s picture

Try requiring DEV again, making sure you instruct Composer to reinstall Charts. There's not even a character on that line anymore, so I think you're facing some sort of cache, etc.

liquidcms’s picture

just looked directly in the zip file that looks like it was created today and i see this:

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      $container->get('config.factory'),
      $container->get('charts.charts_attachment'),
      $container->get('plugin.manager.charts'),
      $container->get('plugin.manager.charts_type'),
      $container->get('current_route_match'),
      $container->get('twig'),
    );
  }

and removing the last comma and i can no uninstall the module.

liquidcms’s picture

and then once that's fixed:

[error] ParseError: syntax error, unexpected ')' in Composer\Autoload\includeFile() (line 93 of /home/nzenzen/public_html/staging/web/modules/contrib/charts/src/Element/Chart.php) #0 /home/nzenzen/public_html/staging/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/home/nzenzen/p...')

fixing this one and then module seems to install properly.

nikathone made their first commit to this issue’s fork.

  • andileco committed c42776e on 5.0.x authored by nikathone
    Issue #3273410 by nikathone:  ParseError: syntax error, unexpected ')' 
    
andileco’s picture

Status: Active » Needs review

@liquidcms, can you pull the latest and report back if it's working now?

liquidcms’s picture

Status: Needs review » Reviewed & tested by the community

Yes, fixed now. Thanks.

andileco’s picture

Status: Reviewed & tested by the community » Fixed

Thank you, and apologies. I will add some tests to ensure this does happen again.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.