diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts
index a3a13a9d70764..f632d40a05621 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/services/has_invalid_but_required_var.ts
@@ -17,7 +17,8 @@ export const hasInvalidButRequiredVar = (
registryVars.find(
(registryVar) =>
registryVar.required &&
- (!packageConfigVars[registryVar.name] ||
+ (!packageConfigVars ||
+ !packageConfigVars[registryVar.name] ||
validatePackageConfigConfig(packageConfigVars[registryVar.name], registryVar)?.length)
)
)
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx
index a832169e39ca3..f4411a6057a15 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx
@@ -278,27 +278,28 @@ export const EditPackageConfigPage: React.FunctionComponent = () => {
};
const configurePackage = useMemo(
- () => (
- <>
-
+ () =>
+ agentConfig && packageInfo ? (
+ <>
+
-
- >
- ),
+
+ >
+ ) : null,
[
agentConfig,
formState,