close STDIN;
close STDOUT;
- $self->_make_components_mutable($class);
+ # Avoid "Setting config after setup" error restarting MyApp.pm
+ $class->setup_finished(0);
+ # Best effort if we can't trap compiles..
+ $self->_make_components_mutable($class)
+ if !Catalyst::Engine::HTTP::Restarter::Watcher::DETECT_PACKAGE_COMPILATION;
my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new(
directory => (
sub _make_components_mutable {
my ($self, $class) = @_;
- my @metas = map { find_meta(@_) } ($class, map { blessed($_) } values %{ $class->components });
+ my @metas = map { find_meta($_) } ($class, map { blessed($_) } values %{ $class->components });
foreach my $meta (@metas) {
$meta->make_mutable if $meta->is_immutable;