Warm tip: This article is reproduced from stackoverflow.com, please click
perl mojolicious

Mojo: Class "Foo::Controller::OAuth" is not a controller

发布于 2020-04-11 11:49:08

For some reason I get this message in my log,

Class "Foo::Controller::OAuth" is not a controller

However, in my Foo::Controller::OAuth I have at the very top,

use Mojo::Base 'Mojolicious::Controller';

What other things can cause this error?

Questioner
Evan Carroll
Viewed
91
Evan Carroll 2020-02-02 06:57

You can get this error if the package name is wrong. For example

package Foo::Controller::Oauth; # notice the lower-case a in 'auth'
use Mojo::Base 'Mojolicious::Controller';

vs

package Foo::Controller::Oauth; # notice the upper-case A in 'Auth'
use Mojo::Base 'Mojolicious::Controller';