Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

fix(templates): surface validate-install errors in the deploy drawer

Juan Denisd3e3564c7d1c
diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsx
index 53ffba95..c23e4810 100644
--- a/frontend/src/pages/Templates.jsx
+++ b/frontend/src/pages/Templates.jsx
@@ -898,7 +898,13 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
setInstalling(false);
}
} catch (err) {
- setErrors([err?.data?.error || err.message || 'Installation failed']);
+ // validate-install 400s with an `errors` ARRAY (no `error` key),
+ // and request() throws on any non-2xx — so invalid input lands
+ // here, never in the `!validation.valid` branch above.
+ const serverErrors = Array.isArray(err?.data?.errors) && err.data.errors.length
+ ? err.data.errors
+ : [err?.data?.error || err.message || 'Installation failed'];
+ setErrors(serverErrors);
setInstalling(false);
}
}