Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: The punycode module is deprecated #459

Open
2 tasks done
diego-aquino opened this issue Nov 3, 2024 · 2 comments
Open
2 tasks done

DeprecationWarning: The punycode module is deprecated #459

diego-aquino opened this issue Nov 3, 2024 · 2 comments
Labels
blocked Blocked bug Something isn't working

Comments

@diego-aquino
Copy link
Member

diego-aquino commented Nov 3, 2024

Prerequisites

  • I confirm that none of the open issues match my problem
  • I confirm that the documentation does not cover a solution to problem

Operating system

Ubuntu 22.04

Runtime

Node.js

Runtime version

22.11.0

Zimic version

0.9.3

Reproduction repository

https://github.com/diego-aquino/zimic-punycode-deprecated

Reproduction steps

  1. pnpm install
  2. NODE_OPTIONS=--trace-deprecation pnpm typegen:github

Current behavior

Even though the command executes successfully, a warning about punycode being deprecated is shown:

$ NODE_OPTIONS=--trace-deprecation pnpm typegen:github

(node:23082) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:114:7)
    at Function._load (node:internal/modules/cjs/loader:1100:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at Object.<anonymous> (/home/diegoaquino/www/zimic-punycode-deprecated/node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
[zimic] ✔ Generated ./src/types/github/typegen/generated.ts (3.06s)

Expected behavior

No deprecation warnings.

@diego-aquino diego-aquino added bug Something isn't working needs triage labels Nov 3, 2024
@diego-aquino diego-aquino self-assigned this Nov 3, 2024
@diego-aquino diego-aquino moved this to In progress in Zimic Nov 3, 2024
@diego-aquino diego-aquino added this to the v0.9.4 milestone Nov 3, 2024
@diego-aquino
Copy link
Member Author

This issue is not caused specifically by Zimic, but by whatwg-url through redocly-cli and openapi-typescript.

Related issues:

For now, Zimic could dynamically import openapi-typescript, so that the warning only appears for zimic typegen openapi instead of all CLI commands.

For a complete fix, we have to wait for Redocly/redocly-cli#1332 and a transitive upgrade in openapi-typescript.

@diego-aquino diego-aquino added blocked Blocked and removed needs triage labels Nov 3, 2024
@diego-aquino diego-aquino moved this from In progress to To do in Zimic Nov 3, 2024
@diego-aquino diego-aquino removed this from the v0.9.4 milestone Nov 3, 2024
@diego-aquino
Copy link
Member Author

For now, Zimic could dynamically import openapi-typescript, so that the warning only appears for zimic typegen openapi instead of all CLI commands.

Dynamic import implemented in #460.

I'm marking this as blocked by Redocly/redocly-cli#1332 for the full fix.

diego-aquino added a commit that referenced this issue Nov 3, 2024
### Fixes
- [#zimic] Changed the `openapi-typescript` import to be dynamic,
reducing the [`punycode` deprecated
warning](#459) to `zimic typegen
openapi` commands.

### Refactoring
- [#zimic, zimic-test-client] Abstracted dynamic import singletons to a
utility `createDynamicImportSingleton`.

Part of #459.
@diego-aquino diego-aquino moved this from To do to Backlog in Zimic Nov 15, 2024
@diego-aquino diego-aquino moved this from Backlog to To do in Zimic Nov 15, 2024
@diego-aquino diego-aquino moved this from To do to Backlog in Zimic Nov 15, 2024
@diego-aquino diego-aquino modified the milestone: Blocked Dec 29, 2024
@diego-aquino diego-aquino removed their assignment Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant