mirror of
https://github.com/strapi/strapi.git
synced 2025-10-13 17:15:33 +00:00
Fix: handle missing plugin with proper error message
This commit is contained in:
parent
7ab3dc34d8
commit
3814f95afc
@ -85,7 +85,15 @@ const loadPlugins = async (strapi) => {
|
|||||||
for (const pluginName of Object.keys(enabledPlugins)) {
|
for (const pluginName of Object.keys(enabledPlugins)) {
|
||||||
const enabledPlugin = enabledPlugins[pluginName];
|
const enabledPlugin = enabledPlugins[pluginName];
|
||||||
|
|
||||||
const serverEntrypointPath = join(enabledPlugin.pathToPlugin, 'strapi-server.js');
|
let serverEntrypointPath;
|
||||||
|
|
||||||
|
try {
|
||||||
|
serverEntrypointPath = join(enabledPlugin.pathToPlugin, 'strapi-server.js');
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(
|
||||||
|
`Error loading plugin ${pluginName}, plugin is not installed, please install the plugin or remove it's configuration.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// only load plugins with a server entrypoint
|
// only load plugins with a server entrypoint
|
||||||
if (!(await fse.pathExists(serverEntrypointPath))) {
|
if (!(await fse.pathExists(serverEntrypointPath))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user