Skip to content

Rush's node_modules structure is not resolved in vscode correctly #28689

Closed
@nfour

Description

@nfour
  • VSCode Version: 1.28.2 (or insiders)
  • OS Version: Arch linux

When trying to auto-import node modules within a rush project, intellisense will not locate dependencies. This also results in the editor crashing or re-initializing the TS server somewhat often.

This is likely due to rush's unique node module structure, and it's unclear if this ever worked as I have only adopted rush somewhat recently.

Steps to Reproduce:

You can replicate this issue within the web-build-tools repo itself.

  1. Open https://github.com/Microsoft/web-build-tools/blob/master/libraries/ts-command-line/src/index.ts
  2. type Colors in the top level (from the colors module). You shouldn't be able to resolve the symbol.

eg.

const foo: Colors = {};

export {
  CommandLineAction,
  ICommandLineActionOptions
} from './CommandLineAction';

This also seems to correlate with the editor's TS server crashing intermittently, but its not clear how to reproduce.

Does this issue occur when all extensions are disabled?: Yes

Versions tested:

  • rush v5.5.2 / v5.3.0
  • node 6 / node 10
  • vscode v1.28.2 / insiders
  • with either of: npm, yarn or pnpm (all latest)
  • has been tested on multiple linux systems

Workaround

If you execute the below script to replace symlinks with real files:

mv node_modules node_modules_old
rsync node_modules_old/ node_modules/ -a --copy-links -v

Everything should work as expected.

There seems to be an issue with symlinks.

Related: microsoft/rushstack#955

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions