Skip to content

Intellisense is not working for self-references and # imports of typescript files in vscodeΒ #57777

Closed
@magnusriga

Description

@magnusriga

πŸ”Ž Search Terms

"imports", "# imports"

πŸ•— Version & Regression Information

  • This is a bug
  • As far as I know, it has never worked

⏯ Playground Link

https://github.com/magnusriga/my-app

πŸ’» Code

// foo.tsx
import { Bar } from "#app/bar"; // Resolved by TS, but lacking Intellisense (ctrl+space suggestions).
import { Baz } from "my-app/baz"; // Resolved by TS, but lacking Intellisense (ctrl+space suggestions).
import { Qux } from "./qux"; // Resolved by TS and has full Intellisense.
export const Foo = () => {
  return (
    <>
      <Bar bar="bar" />
      <Baz baz="baz" />
      <Qux qux="qux" />
    </>
  );
};
// bar.tsx (baz.tsx and qux.tsx are similar)
export const Bar = ({bar}: {bar: string}) => {
  return <div>{bar}</div>
}
// package.json
{
...
 "name": "my-app",
  "imports": {
    "#app/*": "./src/app/*.js"
  },
  "exports": {
    "./*": "./src/app/*.js"
  },
...

I am using "typescript": "5.5.0-dev.20240314".

πŸ™ Actual behavior

The import specifiers do not provide Intellisense suggestions. TS is able to resolve the files however, so there is no TS error.

πŸ™‚ Expected behavior

The expected behavior is for Intellisense to understand the TS resolution and provide suggestions with ctrl+space.

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions