diff --git a/packages/cli-plugin-deploy-pulumi/commands/newWatch/watchers/worker.js b/packages/cli-plugin-deploy-pulumi/commands/newWatch/watchers/worker.js index 27d2952775b..c23eb6ad49b 100644 --- a/packages/cli-plugin-deploy-pulumi/commands/newWatch/watchers/worker.js +++ b/packages/cli-plugin-deploy-pulumi/commands/newWatch/watchers/worker.js @@ -6,18 +6,31 @@ const { cli } = require("@webiny/cli"); // let's intercept those and make sure messages are just forwarded // to the main thread. const types = ["log", "error", "warn"]; + +// Suppress punycode warnings. This is a known issue which we can't fix. +const filterOutPunycodeWarnings = message => { + if (typeof message === "string" && message.includes("punycode")) { + return false; + } + + return true; +}; + for (let i = 0; i < types.length; i++) { const type = types[i]; console[type] = (...message) => { parentPort.postMessage( JSON.stringify({ type, - message: message.filter(Boolean).map(m => { - if (m instanceof Error) { - return m.message; - } - return m; - }) + message: message + .filter(Boolean) + .filter(filterOutPunycodeWarnings) + .map(m => { + if (m instanceof Error) { + return m.message; + } + return m; + }) }) ); }; diff --git a/packages/cli/cli.js b/packages/cli/cli.js index fdd488ea60c..fa20770436b 100644 --- a/packages/cli/cli.js +++ b/packages/cli/cli.js @@ -4,6 +4,9 @@ const yargs = require("yargs"); // Disable help processing until after plugins are imported. yargs.help(false); +// Suppress punycode warnings. This is a known issue which we can't fix. +require("./utils/suppressPunycodeWarnings"); + // Loads environment variables from multiple sources. require("./utils/loadEnvVariables"); diff --git a/packages/cli/utils/suppressPunycodeWarnings.js b/packages/cli/utils/suppressPunycodeWarnings.js new file mode 100644 index 00000000000..0313b790890 --- /dev/null +++ b/packages/cli/utils/suppressPunycodeWarnings.js @@ -0,0 +1,7 @@ +const originalConsoleError = console.error; +console.error = (message, ...args) => { + if (typeof message === "string" && message.includes("punycode")) { + return; + } + originalConsoleError.call(console, message, ...args); +};