diff --git a/packages/migrations/src/removeDnsFromComposeFiles.ts b/packages/migrations/src/removeDnsFromComposeFiles.ts index ad1799f78..6d0aec346 100644 --- a/packages/migrations/src/removeDnsFromComposeFiles.ts +++ b/packages/migrations/src/removeDnsFromComposeFiles.ts @@ -24,7 +24,9 @@ export function removeDnsFromPackageComposeFile(dnpName: string, isCore: boolean for (const serviceName of Object.keys(services)) { const composeService = services[serviceName].get(); - if (composeService.dns) { + // check composeService has the key dns + + if (Object.prototype.hasOwnProperty.call(composeService, "dns")) { logs.info(`Removing DNS from ${serviceName} in ${dnpName} compose file`); // setting undefined a yaml property might result into an error afterwards making js-yaml // adding the following value to the undefined `Error parsing YAML: unknown tag !`