I'm trying to load my MySQL provider file but there seem to be 2 errors every time. I'm currently using a virion called libasynql. Error 1: Code: 22.07 12:53:59 [Server] Server thread/CRITICAL TypeError: "Return value of core\provider\MySQLProvider::getDatabase() must be an instance of poggit\libasynql\DataConnector, null returned" (EXCEPTION) in "PlexFac/src/core/provider/MySQLProvider" at line 48 Code to it: PHP: public function __construct(Core $core) { parent::__construct($core); $config = $core->getConfig()->get("database"); $this->database = libasynql::create($core, $config, [ "mysql" => "mysql/queries.sql" ]); $this->init();}public function getDatabase(): DataConnector { return $this->database; // Line 48} Error 2: Code: 22.07 12:53:59 [Server] Server thread/CRITICAL TypeError: "Return value of core\Core::getProvider() must be an instance of core\provider\MySQLProvider, null returned" (EXCEPTION) in "PlexFac/src/core/Core" at line 176 Code to it: PHP: public function onEnable() { // Making folders and saving resources $this->provider = new MySQLProvider($this);}public function onDisable() { $provider = $this->getProvider(); $provider->getDatabase()->close();}public function getProvider(): MySQLProvider { // Line 176 return $this->provider;} Configuration file: PHP: database: type: mysql host: 127.0.0.1 username: root password: admin schema: Database
Are there other errors above them? It seems that your plugin crashed before the database is created, and the errors are from onDisable.
Yes, and it is in the libasynql code. Most likely libasynql threw an exception that crashed your plugin, but you didn't check it.
I'm unsure if libasynql even loaded. It didn't state that libasynql was loaded in the loggers, which I think it's supposed to.
Are you sure there is no other error messages? Also, are you using devirion, or are you using a packaged phar?