diff --git a/desktop/app/src/dispatcher/plugins.tsx b/desktop/app/src/dispatcher/plugins.tsx index ccd87feaa..73813d6b0 100644 --- a/desktop/app/src/dispatcher/plugins.tsx +++ b/desktop/app/src/dispatcher/plugins.tsx @@ -289,8 +289,16 @@ const requirePluginInternal = ( if (plugin.default) { plugin = plugin.default; } - if (!(plugin.prototype instanceof FlipperBasePlugin)) { - throw new Error(`Plugin ${plugin.name} is not a FlipperBasePlugin`); + if (plugin.prototype === undefined) { + throw new Error( + `Plugin ${pluginDetails.name} is neither a class-based plugin nor a Sandy-based one. + Ensure that it exports either a FlipperPlugin class or has flipper-plugin declared as a peer-dependency and exports a plugin and Component. + See https://fbflipper.com/docs/extending/sandy-migration/ for more information.`, + ); + } else if (!(plugin.prototype instanceof FlipperBasePlugin)) { + throw new Error( + `Plugin ${pluginDetails.name} is not a FlipperBasePlugin`, + ); } if (plugin.id && pluginDetails.id !== plugin.id) {