Skip to content

Silence punycode deprecation notice#10395

Merged
joehan merged 2 commits intonextfrom
jh-fix-punycode
Apr 21, 2026
Merged

Silence punycode deprecation notice#10395
joehan merged 2 commits intonextfrom
jh-fix-punycode

Conversation

@joehan
Copy link
Copy Markdown
Member

@joehan joehan commented Apr 21, 2026

Description

Silence the punycode deprecation warning that was being printed pout during deploy on Node 22. This is coming from a transitive dependency and has no effect on our users, so this was pure noise. Fixes #10385

### Description
Added a warning handler in the CLI entry point to ignore the `DEP0040` (punycode deprecation) warning. This warning is triggered by dependencies (like `tr46`) on Node 22 because Node 22 deprecates the built-in `punycode` module. Since we cannot easily update the dependencies to avoid it without risking regressions or security issues, ignoring the specific warning is the safest approach.
Fixes #10385

### Scenarios Tested
- Verified that unit tests pass (4269 passing).
- Verified that the changes are limited to `src/bin/firebase.ts` and `CHANGELOG.md`.

### Sample Commands
None (this is an internal warning suppression).
@joehan joehan changed the base branch from main to next April 21, 2026 17:11
@joehan joehan changed the title jh fix punycode Silence punycode deprecation notice Apr 21, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several significant updates, including SSE mode support for the Firebase MCP server, a new MCP App for environment management, and enhanced security checks for hosting deployments. It also implements secret resolution for local App Hosting builds with a new flag and interactive prompts. Feedback addresses a typo in the changelog and highlights several instances where the "any" type was used in violation of the repository's style guide, particularly in the new test files and MCP application logic.

I am having trouble creating individual review comments. Click here to see my feedback.

CHANGELOG.md (2)

medium

There seems to be a typo in the pull request number. The PR description for this fix refers to #10380, but the changelog says #10376. For better traceability, it would be good to keep these consistent.

- Fixed an issue where hosting deploy allowed publishing to a site in a different project. (#10380)

src/appdistribution/distribution.spec.ts (71)

medium

This file makes extensive use of any and unknown as any, which is discouraged by the repository's style guide (GEMINI.md, line 38: "Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards.").

While this is a test file, adhering to stricter typing improves test reliability and maintainability. Consider using partial types (e.g., Partial<Release>) or defining mock objects that more closely match the required interfaces to avoid these type assertions.

For example, here on line 71, instead of casting to any, you could define a more complete mock object for the release.

References
  1. Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)

src/mcp/apps/update_environment/mcp-app.ts (15)

medium

This file uses the any type in several places (e.g., for projects, ctx in onhostcontextchanged, and when parsing tool results), which goes against the repository's style guide (GEMINI.md, line 38: "Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards.").

To improve type safety and code clarity, please define interfaces for these objects. For instance, for the projects array, you could define a Project interface:

interface Project {
  projectId: string;
  displayName?: string;
}
let projects: { projectId: string; displayName?: string }[] = [];
References
  1. Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)

@joehan joehan requested a review from aalej April 21, 2026 17:15
Copy link
Copy Markdown
Contributor

@aalej aalej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested locally and the warning message is no longer present

  • on branch jh-fix-punycode
$ firebase deploy --dry-run

=== Deploying to 'PROJECT_ID'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
  • npm i -g firebase-tools
$ firebase deploy --dry-run
(node:28010) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

=== Deploying to 'PROJECT_ID'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

@joehan joehan merged commit 3b658b4 into next Apr 21, 2026
90 of 92 checks passed
@joehan joehan deleted the jh-fix-punycode branch April 21, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants