-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5.38 and module_true: File "/app/x.pl" did not return an application object #2094
Comments
Does it help if you wrote |
That sucks. We probably need an FAQ entry for this and recommend against the use of the |
No, same error. |
I'll search for the FAQ and send a PR, glad to help. |
You can just feature->unimport( 'module_true' ) if $^V ge v5.38; in your main |
That's a little unfortunate too as then class files will still have to end in |
Using @leonerd suggestion and adding the following feature->unimport( 'module_true' ) if $^V ge v5.38; before the Not sure if that is the way to go. I like it, and it is just scoped to the use of |
That will work until Mojo::Base's import would load 5.38, but that's a while off and even then we could probably inspect the hints hash to see if it has already been unimported from outside or something. I like it. |
@jberger I like it too, seems the most local and clean way to deal with it. I experimented with edited: cute... This sets the hint hash and I can see use feature ':5.38'; but this doesn't set the hints hash: use v5.38; I still think just removing the feature is the way to go. edited, again: I actually believe that the hint hash not been set when implicit bundle load is used to be a perl bug, so I also opened this: Perl/perl5#21387 |
Updated version of the fix, more precise: feature->unimport( 'module_true' ) if feature::feature_enabled('module_true', 1); edited: the |
Steps to reproduce the behavior
This is not a Mojolicious bug but a side effect of using v5.38 feature bundle. I'm creating the issue just to leave a note on this, for others that might see this error message.
Morbo fails to load app with error
File "/app/x.pl" did not return an application object.
The minimal script:
Run with
morbo
:This works:
The feature bundle
v5.38
activates themodule_true
feature. This adds an implicitreturn 1;
at the end of the script file. To make it work we just need tounimport
the feature.Bye,
The text was updated successfully, but these errors were encountered: