TEGG_EGG_PROTO_NOT_FOUND
Problem
bash
framework.EggPrototypeNotFound: Object foo not found in LOAD_UNIT:appPortCause
The corresponding Proto was not found in the current Egg Module, resulting in injection failure.
Solution
- Ensure that the corresponding Proto is defined in the current Module.
- Ensure that the Proto's access level is set to
AccessLevel.PUBLIC. - Ensure that the Proto's name is correct.
- Ensure that the Proto's instantiation method is correct.
- Ensure that the Proto's instantiation name is correct.
- Ensure that the Proto's instantiation access level is correct.
- Ensure that the Proto's instantiation instance name is correct.
Example
ts
import { SingletonProto, AccessLevel } from 'egg';
@SingletonProto({
// Ensure the Proto's access level is PUBLIC
accessLevel: AccessLevel.PUBLIC,
})
export class Foo {
async bar(): Promise<string> {
return 'bar';
}
}