I have a custom module loaded in via composer in vendor/data-table.
Although I think I have everything set up correctly, I get the following error:
PHP Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (MJErwin\DataTable) could not be initialized.' in /Applications/MAMP/htdocs/rota/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:189
If I remove MJErwin\DataTable from my application.config.php everything works fine, so it appears to be an issue with the module itself.
The structure is as follows:

My Module.php:
namespace MJErwin\DataTable;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements ConfigProviderInterface
{
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return [
'Zend\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
],
],
];
}
}
module.config.php:
return [
'view_manager' => [
'template_path_stack' => [
__DIR__ . '/../view',
],
],
];
Then in application.config.php:
<?php
/**
* Configuration file generated by ZFTool
* The previous configuration file is stored in application.config.old
*
* @see https://github.com/zendframework/ZFTool
// */
return [
'modules' => [
'Application',
'MJErwin\\DataTable',
'DoctrineModule',
'DoctrineORMModule',
'Environment',
'ZendDeveloperTools',
'ZfcTwig',
'ZfcBase',
'ZfcUser',
'ZfcUserDoctrineORM',
'Navigation'
],
'module_listener_options' => [
'module_paths' => [
'./module',
'./vendor'
],
'config_glob_paths' => [
'config/autoload/{,*.}{global,local}.php'
]
],
];