usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
25.39k stars 1.16k forks source link

Deprecation warning about punycode module when running bru CLI #2014

Open EppO opened 5 months ago

EppO commented 5 months ago

Hi,

When running bru CLI, it displays the following warning message:

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

My Test Collection (200 OK) - 391 ms
   ✓ assert: res.status: eq 200
   ✓ assert: res.headers['content-type']: contains text/html

Requests:    1 passed, 1 total
Tests:       0 passed, 0 total
Assertions:  2 passed, 2 total
Ran all requests - 391 ms

I just started using Bruno and I love it! Thanks a lot for your work, really appreciated 🙏

jwetzell commented 5 months ago

What version of the CLI are you using on what OS/Version? I just installed the cli v.1.11.0 and ran bru run in a collection with a couple requests, with scripts and tests and don't see the deprecation warning.

DanaEpp commented 5 months ago

I'm seeing the error on macOS 14.4.1 with bru cli 1.11.0

image

jwetzell commented 5 months ago

That is my exact setup. How did you install bru CLI?

Update: I am now able to reproduce by using a node version of 21.

jwetzell commented 5 months ago

Besides adding the userland version of punycode and using it in bruno-js's own imports. The chain of dependencies that is going to still spit out that warning is: node-fetch@2.x -> whatwg-url@5.0.0 -> tr46@0.0.3 -> node:punycode.

But node v21 has the fetch api stable and built-in so hopefully the dependency on node-fetch can be ditched altogether there.

platform-kit commented 2 months ago

@jwetzell @DanaEpp any update on this? I'm still getting the punycode warning on latest CLI and node v22.

jwetzell commented 2 months ago

@platform-kit my last comment still holds. The node-fetch dependency in @usebruno/js needs to be removed to remove this deprecation warning when using node versions >= 21