Skip to content

Moving a folder that's imported using a path alias does not update the import paths.Β #59603

Closed
@Bunkerbewohner

Description

@Bunkerbewohner

πŸ”Ž Search Terms

"vscode path alias import"

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried.

⏯ Playground Link

No response

πŸ’» Code

Given some TS project where a folder is mapped using path aliases, e.g. mapping "@app" to the root folder.

import { foo } from '@app/bar/folder/module'

Move the folder folder to a different parent, e.g. baz, using VSCode.

πŸ™ Actual behavior

The imports referencing the moved files are not updated when the VScode setting typescript.tsserver.experimental.useVsCodeWatcher is enabled.
When disabling the setting, the behavior is as expected (see below).

πŸ™‚ Expected behavior

The import referencing the module should be updated automatically to

import { foo } from '@app/baz/folder/module'

Additional information about the issue

See https://github.com/Bunkerbewohner/vscode-path-alias-problem for a reproduction repo.

Metadata

Metadata

Assignees

Labels

FixedA PR has been merged for this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions