diff --git a/packages/lib/services/plugins/PluginService.ts b/packages/lib/services/plugins/PluginService.ts index a2a103e32..1b9338279 100644 --- a/packages/lib/services/plugins/PluginService.ts +++ b/packages/lib/services/plugins/PluginService.ts @@ -584,7 +584,17 @@ export default class PluginService extends BaseService { // from where it is now to check that it is valid and to retrieve // the plugin ID. const preloadedPlugin = await this.loadPluginFromPath(jplPath); - await this.deletePluginFiles(preloadedPlugin); + try { + await this.deletePluginFiles(preloadedPlugin); + } catch (error) { + // Deleting the plugin appears to occasionally fail on Windows (maybe because the files + // are still loaded?), and it prevents the plugin from being installed. Because of this + // we just ignore the error - it means that there will be unnecessary files in the cache + // directory, which is not a big issue. + // + // Ref: https://discourse.joplinapp.org/t/math-mode-plugin-no-longer-works-in-windows-v3-1-23/41853 + logger.warn('Could not delete plugin temp directory:', error); + } // On mobile, it's necessary to create the plugin directory before we can copy // into it.