Skip to content

Commit

Permalink
fix: suppress punycode warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Dec 23, 2024
1 parent b7d568f commit f8b6c1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/handler/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Suppress punycode warnings. This is a known issue which we can't fix.
import "./suppressPunycodeWarnings";

export * from "~/fastify";
export * from "~/Context";
export * from "~/ResponseHeaders";
Expand Down
7 changes: 7 additions & 0 deletions packages/handler/src/suppressPunycodeWarnings.ts
Original file line number Diff line number Diff line change
@@ -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);
};

0 comments on commit f8b6c1e

Please sign in to comment.