site/docs/faq/TEGG_EGG_PROTO_NOT_FOUND.md
framework.EggPrototypeNotFound: Object foo not found in LOAD_UNIT:appPort
The corresponding Proto was not found in the current Egg Module, resulting in injection failure.
AccessLevel.PUBLIC.import { SingletonProto, AccessLevel } from 'egg';
@SingletonProto({
// Ensure the Proto's access level is PUBLIC
accessLevel: AccessLevel.PUBLIC, // [!code focus]
})
export class Foo {
async bar(): Promise<string> {
return 'bar';
}
}