1. I am trying to upgrade one of my drupal 7 module
2. drush dmu-analyze mmodulename ran successfully.
3. Tried to run the module upgrade command drush dmu-upgrade mymodulename but it is throwing following error

PHP Fatal error:  Undefined class constant 'DUMP_EXCEPTION_ON_INVALID_TYPE' in /var/www/html/drupal/core/lib/Drupal/Component/Serialization/YamlSymfony.php on line 22
Drush command terminated abnormally due to an unrecoverable error.                                                                          [error]
Error: Undefined class constant 'DUMP_EXCEPTION_ON_INVALID_TYPE' in
/var/www/html/drupal/core/lib/Drupal/Component/Serialization/YamlSymfony.php, line 22

Using Drupal 8 version 8.5.x

Comments

Prashant.c created an issue. See original summary.

HongPong’s picture

Similarly I got on 8.4.2, drush dmu-analyze scrollbar --path=modules/custom/scrollbar when I had in a custom subdirectory it gave the error here.

Error: Undefined class constant 'PARSE_EXCEPTION_ON_INVALID_TYPE' in [error]
Drupal\Component\Serialization\YamlSymfony::decode() (line 37 of
/web/core/lib/Drupal/Component/Serialization/YamlSymfony.php)
#0

Then trying to do dmu-analyze scrollbar did work. In some cases drush cr helps to push ahead.

labboy0276’s picture

I ran composer update in the Drupal Module Upgrader module itself and it fixed the DUMP_EXCEPTION_ON_INVALID_TYPE issue.

ryan.gibson’s picture

A composer update within the contrib module did fix it. But that's with using the dev version of the module. So it seems like there's a few zigs and zags necessary to use it (hopefully use it correctly).

knyshuk.vova’s picture

composer update in the Drupal Module Upgrader module itself works fine and resolve the issue for me.

nithinkolekar’s picture

module's page needs to be updated with this working trick #3
and also Drush 8 as required version. ref:forum post

arunkumark’s picture

Am also facing the same issue on my Drupal instance. I have tried to clear the Drush cache, cleared the Drupal cache, updated the composer.

Error: Undefined class constant 'DUMP_EXCEPTION_ON_INVALID_TYPE' in 

Error: Undefined class constant 'DUMP_EXCEPTION_ON_INVALID_TYPE' in Drupal\Component\Serialization\YamlSymfony::encode()
HongPong’s picture

arunkumark what path is the module you are trying to examine at? if it is in "modules/custom" that didn't work for me and it had to be in "modules". Hope that helps a bit.

arunkumark’s picture

@HongPong Yes am running the module keeping under the modules directory. The drush dmu-analyze is working fine but drush dmu-upgrade get fails while running.

arunkumark’s picture

I have resolved the issue by running the composer update inside the drupalmoduleupgrader module.

As per the comment #3

Anybody’s picture

Status: Active » Closed (works as designed)

I can also confirm #10. Thanks a lot. It would be nice to have a new dev release with the 8.5.x conflicts removed. Marking this closed.

HongPong’s picture

@Anybody I'm aiming to tag a new release next week when I have some time - if there are any other issues here you can move to RTBC before then we can slide them in :) Thanks for helping clarify this one.

bennof’s picture

I confirm solutions #5 and #10 composer update, thanks!