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

Use of deprecated Deno.TcpConn.rid in built-in Node compat layer #22116

Closed
jtoppine opened this issue Jan 25, 2024 · 0 comments · Fixed by #22120
Closed

Use of deprecated Deno.TcpConn.rid in built-in Node compat layer #22116

jtoppine opened this issue Jan 25, 2024 · 0 comments · Fixed by #22120

Comments

@jtoppine
Copy link

Node compat layer uses deprecated API Deno.TcpConn.rid.

This becomes a bit more annoying than it would otherwise be, due to the fact that starting from Deno 1.40 these deprecation warnings are automatically printed to the console.

For example, using MongoDB with the official npm:mongodb driver results in the following output mixed in amongst regular deno test output (there's also some repetition in the messages).

------- output -------
warning: Use of deprecated "Deno.TcpConn.rid" API. This API will be removed in Deno 2.
Stack trace:
  at ext:deno_node/internal_binding/tcp_wrap.ts:295:14
hint: Use `Deno.TcpConn` instance methods instead.
hint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency.
warning: Use of deprecated "Deno.TcpConn.rid" API. This API will be removed in Deno 2.
hint: Use `Deno.TcpConn` instance methods instead.
warning: Use of deprecated "Deno.TcpConn.rid" API. This API will be removed in Deno 2.
hint: Use `Deno.TcpConn` instance methods instead.
----- output end -----
    empty test db ... ok (53ms)

It would be nice to be able suppress deprecation warnings altogether from third party libraries and other things the user can't directly control. But maybe that belongs in a separate discussion or issue (?). I guess this particular issue is more about the actual usage of deprecated API in the node compat layer which is the root cause here. But feel free to make that judgement, either approach could solve the inconvenience.

Deno 1.40.1

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 a pull request may close this issue.

1 participant