denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.83k stars 5.39k forks source link

LSP: auto import to `.js` file even though the actual file is a `.d.ts` file #23869

Open lucacasonato opened 6 months ago

lucacasonato commented 6 months ago
import * as d3 from "https://esm.sh/d3@7.9.0";

Enter stack and accept the auto complete result from https://esm.sh/v135/@types/d3-shape@3.1.5.

You will get an import to https://esm.sh/v135/@types/d3-shape@3.1.5/index.js. This file does not exist, it should have been an import to https://esm.sh/v135/@types/d3-shape@3.1.5/index.d.ts:

import * as d3 from "https://esm.sh/d3@7.9.0";
import { stack } from "https://esm.sh/v135/@types/d3-shape@3.1.5/index.js";

stack

Version: Deno 1.43.4

lucacasonato commented 5 months ago

Possible duplicate https://github.com/denoland/deno/issues/23017

yasaichi commented 4 months ago

@lucacasonato This bug also seems to make input completion in editors like VSCode have broken down since 1.43.0 in a project where the byonm flag is enabled. Here is the minimum project to reproduce it. https://github.com/yasaichi/repro-denoland-deno-23869 \ You will be able to find that this issue is not happening in v1.42.4 using the project.

I hope it will lead to putting more importance on resolving this issue. Thanks.