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

[dts] node builtin should have correct type for deno version > 1.30.3 #18438

Closed
loynoir opened this issue Mar 26, 2023 · 1 comment
Closed

[dts] node builtin should have correct type for deno version > 1.30.3 #18438

loynoir opened this issue Mar 26, 2023 · 1 comment
Labels
bug Something isn't working correctly node compat

Comments

@loynoir
Copy link

loynoir commented Mar 26, 2023

Background

According to release log

  • deno version <= 1.30.3 use https://deno.land/std@XXX/node/foobar.ts XXX <= 0.177.0, which have correct type
  • deno version > 1.30.3 use node:foobar, which have wrong type

Effected Range

1.30.3 < deno version <= 1.32.1

Before migration

import { readFile } from "https://deno.land/[email protected]/node/fs/promises.ts";

console.log(readFile);

Hover on readFile got correct type indication

(alias) const readFile: ((path: string | URL, opt: TextOptionsArgument) => Promise<string>) & ((path: string | URL, opt?: BinaryOptionsArgument | undefined) => Promise<...>) & ((path: string | URL, opt?: FileOptionsArgument | undefined) => Promise<...>)
import readFile

After migration: Actual

import { readFile } from "node:fs/promises";

console.log(readFile);

Hover on readFile got WRONG type indication

import readFile

After migration: Expected

import { readFile } from "node:fs/promises";

console.log(readFile);

Hover on readFile got correct type indication

(alias) const readFile: ((path: string | URL, opt: TextOptionsArgument) => Promise<string>) & ((path: string | URL, opt?: BinaryOptionsArgument | undefined) => Promise<...>) & ((path: string | URL, opt?: FileOptionsArgument | undefined) => Promise<...>)
import readFile

Links

https://github.com/denoland/deno_std/releases/tag/0.177.0
https://github.com/denoland/deno_std/releases/tag/0.178.0
https://github.com/denoland/deno/releases/tag/v1.30.3
https://github.com/denoland/deno/releases/tag/v1.31.0

@loynoir loynoir changed the title node builtin should have type indication for deno version > 1.30.3 node builtin should correct type for deno version > 1.30.3 Mar 26, 2023
@loynoir loynoir changed the title node builtin should correct type for deno version > 1.30.3 node builtin should have correct type for deno version > 1.30.3 Mar 26, 2023
@loynoir loynoir changed the title node builtin should have correct type for deno version > 1.30.3 [dts] node builtin should have correct type for deno version > 1.30.3 Mar 27, 2023
@aapoalas aapoalas added bug Something isn't working correctly node compat labels Apr 15, 2023
@loynoir
Copy link
Author

loynoir commented Apr 20, 2023

Closed. I believe it's caused by one of below, that denoland.vscode-deno

  • or does not support --node-modules-dir=false,
  • or a node_modules without node_modules/.deno
  • or some wrong cache, if there is cache, between lsp restart

@loynoir loynoir closed this as completed Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

2 participants