Skip to content

[rush] Rush's node_modules structure is not resolved in vscode correctly #955

Closed
@nfour

Description

@nfour

First up, I'm not sure if this is the right place for this report, but it's likely going to be relevant to the contributers here.

Problem

My team has run into a curious issue with rush's node module structure and vscode.

When trying to auto-import node modules within a project, intellisense will not locate dependencies.

This also results in the editor's TS server crashing intermittently.

Reproduction

Rush setups tested:

  • v5.5.2 / v5.3.0
  • node 6 / node 10
  • vscode v1.28.2 / insiders
  • with either of: npm, yarn or pnpm (all latest)

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

Open https://github.com/Microsoft/web-build-tools/blob/master/libraries/ts-command-line/src/index.ts

And type Colors in the top level (from the colors module). You shouldn't be able to resolve the symbol.

eg.

Colors

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    external issueThe root cause is with an external component that needs a fix or workaround

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions