Skip to content

Fix punycode deprecation warning #324

@willosborne

Description

@willosborne

Bug Report

Running the CALM CLI on my machine gives me the following warning:

(node:15726) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

This indicates one of the transitive dependencies is still using the bundled version of the punycode library, that will be removed eventually. Presumably this will then break the CLI.

Steps to Reproduce:

Run the validate command on Node version 21.7.2

➜  pattern git:(pattern-only-validation) ✗ node --version
v21.7.2
➜  pattern git:(pattern-only-validation) ✗ calm validate -p api-gateway.json
info:    Loading meta schema(s) from [REDACTED]/architecture-as-code/cli/dist/calm/meta
info:    Loading pattern from : api-gateway.json
(node:16102) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info:    The JSON Schema is valid

Expected Result:

No warning

Actual Result:

Deprecation warning. With the --trace-deprecation flag:

➜ pattern git:(pattern-only-validation) ✗ node --trace-deprecation ../../cli/dist/index.js validate -p api-gateway.json
info: Loading meta schema(s) from [REDACTED]/architecture-as-code/cli/dist/calm/meta
info: Loading pattern from : api-gateway.json
(node:16351) [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:398:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
at loadBuiltinModule (node:internal/modules/helpers:104:7)
at Module._load (node:internal/modules/cjs/loader:999:17)
at Module.require (node:internal/modules/cjs/loader:1230:19)
at require (node:internal/modules/helpers:179:18)
at Object. ([REDACTED]/architecture-as-code/cli/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
at Module._compile (node:internal/modules/cjs/loader:1368:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
info: The JSON Schema is valid
➜ pattern git:(pattern-only-validation) ✗

Environment:

OS: Ubuntu 22.04.4 LTS
Node version: 21.7.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions