Just recently after an upgrade to some CPAN modules I started getting this crash on one of my machines when the
Catalyst::View::JSON was loaded.
# Error: Couldn't instantiate component "TestApp::View::JSON", "Recursive inheritance detected in package 'Types::Serialiser::BooleanBase' at (eval 1547) line 76."Compilation failed in require at (eval 4) line 2.
The actual source of that error appears to be
JSON::XS rather than
I didn’t investigate the error properly, or really fix it properly. Instead I tested out one of the newer features of
-U uninstall flag. I simply uninstalled
JSON::XS and hey presto, no more crash.
cpanm -U JSON::XS JSON::XS contains the following files: /home/colin/perl5/perlbrew/perls/perl-5.14.4/bin/json_xs /home/colin/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/x86_64-linux/JSON/XS.pm /home/colin/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/x86_64-linux/JSON/XS/Boolean.pm /home/colin/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/x86_64-linux/auto/JSON/XS/XS.bs /home/colin/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/x86_64-linux/auto/JSON/XS/XS.so /home/colin/perl5/perlbrew/perls/perl-5.14.4/man/man1/json_xs.1 /home/colin/perl5/perlbrew/perls/perl-5.14.4/man/man3/JSON::XS.3 /home/colin/perl5/perlbrew/perls/perl-5.14.4/man/man3/JSON::XS::Boolean.3 Are you sure you want to uninstall JSON::XS? [y] y
That probably warrants some explanation. The new
Catalyst::Runtime now appears to pull in the new alternative to
Cpanel::JSON::XS so this can now be used instead, and so things just worked. It’s probably a bit drastic a solution for most systems at the moment, I’m sure it will demonstrate any places where I have direct dependencies on
JSON::XS. On my development box that should be handy however. I’d rather be using a single library for that single purpose.