Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nfour opened this issue Nov 22, 2018 · 35 comments · Fixed by #37387
Closed

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

nfour opened this issue Nov 22, 2018 · 35 comments · Fixed by #37387
Assignees
Labels
Fix Available A PR has been opened for this issue Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects")

Comments

@nfour
Copy link

nfour commented Nov 22, 2018

  • 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

@alexdima alexdima assigned mjbvz and unassigned alexdima Nov 23, 2018
@octogonz
Copy link

@mjbvz let us know if there's any help you need investigating this issue. Rush is pretty widely used internally at Microsoft, so if there is a problem with its symlinking strategy, we'd like to get that fixed.

I'll point out that the symbolic links were recently converted to use relative paths. I wonder if that could be related...

@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 27, 2018
@mjbvz mjbvz removed their assignment Nov 27, 2018
@weswigham weswigham added Bug A bug in TypeScript Needs Investigation This issue needs a team member to investigate its status. Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects") labels Nov 27, 2018
@nfour
Copy link
Author

nfour commented Nov 29, 2018

Seems I am getting this error in the TSServer output panel of vscode:

[Error  - 10:56:03 AM] 'signatureHelp' request failed with error.
Error processing request. Cannot read property 'pos' of undefined
TypeError: Cannot read property 'pos' of undefined
    at Object.rangeContainsRange (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:92870:41)
    at _loop_6 (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:103736:36)
    at getContainingArgumentInfo (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:103743:31)
    at Object.getSignatureHelpItems (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:103358:32)
    at Object.getSignatureHelpItems (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:117586:37)
    at IOSession.Session.getSignatureHelpItems (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:125409:62)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:124364:61)
    at /opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:125830:88
    at IOSession.Session.executeWithRequestId (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:125821:28)
    at IOSession.Session.executeCommand (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:125830:33)
    at IOSession.Session.onMessage (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:125852:35)
    at Interface.<anonymous> (/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/tsserver.js:127112:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:282:10)
    at Interface._normalWrite (readline.js:424:12)
    at Socket.ondata (readline.js:141:10)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)
[Error  - 11:12:41 AM] 'signatureHelp' request failed with error.

This correlates with the TS Server showing Loading... on hover over stuff that should be typed.

The tsserver-log contains the below around that time (before).

[11:6:20.480] Got install request {"projectName":"/dev/null/inferredProject1*","fileNames":["/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es5.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2016.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.dom.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.dom.iterable.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.scripthost.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.core.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.collection.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.generator.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.iterable.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.promise.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.proxy.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.reflect.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.symbol.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2016.array.include.d.ts","/opt/visual-studio-code-insiders/resources/app/extensions/node_modules/typescript/lib/lib.es2016.full.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/bluebird/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/execa/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/fs-extra/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/inquirer/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/jest/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/js-yaml/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/common.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/array.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/collection.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/date.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/function.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/lang.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/math.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/number.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/object.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/seq.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/string.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/common/util.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/puppeteer/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/uuid/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/yargs/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/aws-sdk/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/moment/moment.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-jest/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-node/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint/lib/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/typescript/lib/typescript.d.ts"],"compilerOptions":{"module":1,"target":3,"jsx":1,"checkJs":true,"allowJs":true,"allowSyntheticDefaultImports":true,"allowNonTsExtensions":true,"noEmitForJsFiles":true},"typeAcquisition":{"enable":true,"include":[],"exclude":[]},"unresolvedImports":["make-error"],"projectRootPath":"/home/sam/W/TEMANDO/temonodo/tests/suite","kind":"discover"}
[11:6:20.480] Explicitly included types: []
[11:6:20.481] Typing names in '/home/sam/W/TEMANDO/temonodo/tests/suite/package.json' dependencies: ["@temando/errors","@temando/marco","@temando/schemas","@temando/sdk","@types/bluebird","@types/execa","@types/fs-extra","@types/inquirer","@types/jest","@types/js-yaml","@types/lodash","@types/node","@types/puppeteer","@types/uuid","@types/yargs","aws-sdk","bluebird","colors","execa","fermenter","fs-extra","inquirer","jest-environment-node","jest","js-yaml","lodash","moment","puppeteer","signal-exit","ts-jest","ts-node","tslint-config-temando","tslint","typescript","uuid","yargs"]
[11:6:20.503] Searching for typing names in /home/sam/W/TEMANDO/temonodo/tests/suite/node_modules; all files: ["/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/aws-sdk/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/bluebird/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/colors/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/execa/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/fermenter/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/fermenter/tsconfig.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/fermenter/tslint.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/fs-extra/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/inquirer/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/jest/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/jest-environment-node/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/jest-spec-reporter/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/js-yaml/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/lodash/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/moment/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/puppeteer/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/signal-exit/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-jest/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-jest/tsconfig.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-jest/tslint.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-node/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint-config-temando/package-deps.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint-config-temando/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint-config-temando/tsconfig.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint-config-temando/tslint.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/typescript/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/uuid/.eslintrc.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/uuid/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/yargs/package.json"]
[11:6:20.504]     Package 'aws-sdk' provides its own types.
[11:6:20.512]     Package 'moment' provides its own types.
[11:6:20.514]     Package 'ts-jest' provides its own types.
[11:6:20.515]     Package 'ts-node' provides its own types.
[11:6:20.515]     Package 'tslint' provides its own types.
[11:6:20.518]     Package 'typescript' provides its own types.
[11:6:20.520]     Found package names: ["bluebird","colors","execa","fermenter","fs-extra","inquirer","jest","jest-environment-node","jest-spec-reporter","js-yaml","lodash","puppeteer","signal-exit","tslint-config-temando","uuid","yargs"]
[11:6:20.520] Inferred typings from unresolved imports: ["make-error"]
[11:6:20.520] Result: {"cachedTypingPaths":["/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/aws-sdk/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/bluebird/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/execa/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/fs-extra/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/inquirer/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/jest/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/js-yaml/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/moment/moment.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/puppeteer/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-jest/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-node/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint/lib/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/typescript/lib/typescript.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/uuid/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/yargs/index.d.ts"],"newTypingNames":["@temando/errors","@temando/marco","@temando/schemas","@temando/sdk","@types/bluebird","@types/execa","@types/fs-extra","@types/inquirer","@types/jest","@types/js-yaml","@types/lodash","@types/node","@types/puppeteer","@types/uuid","@types/yargs","colors","fermenter","jest-environment-node","signal-exit","tslint-config-temando","jest-spec-reporter","make-error"],"filesToWatch":["/home/sam/W/TEMANDO/temonodo/tests/suite/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/bower_components","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules"]}
[11:6:20.520] Finished typings discovery: {"cachedTypingPaths":["/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/aws-sdk/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/bluebird/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/execa/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/fs-extra/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/inquirer/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/jest/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/js-yaml/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/moment/moment.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/puppeteer/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-jest/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-node/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint/lib/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/typescript/lib/typescript.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/uuid/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/yargs/index.d.ts"],"newTypingNames":["@temando/errors","@temando/marco","@temando/schemas","@temando/sdk","@types/bluebird","@types/execa","@types/fs-extra","@types/inquirer","@types/jest","@types/js-yaml","@types/lodash","@types/node","@types/puppeteer","@types/uuid","@types/yargs","colors","fermenter","jest-environment-node","signal-exit","tslint-config-temando","jest-spec-reporter","make-error"],"filesToWatch":["/home/sam/W/TEMANDO/temonodo/tests/suite/package.json","/home/sam/W/TEMANDO/temonodo/tests/suite/bower_components","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules"]}
[11:6:20.520] Installing typings ["@temando/errors","@temando/marco","@temando/schemas","@temando/sdk","@types/bluebird","@types/execa","@types/fs-extra","@types/inquirer","@types/jest","@types/js-yaml","@types/lodash","@types/node","@types/puppeteer","@types/uuid","@types/yargs","colors","fermenter","jest-environment-node","signal-exit","tslint-config-temando","jest-spec-reporter","make-error"]
[11:6:20.520] '@temando/errors' is in missingTypingsSet - skipping...
[11:6:20.521] '@temando/marco' is in missingTypingsSet - skipping...
[11:6:20.521] '@temando/schemas' is in missingTypingsSet - skipping...
[11:6:20.521] '@temando/sdk' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/bluebird' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/execa' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/fs-extra' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/inquirer' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/jest' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/js-yaml' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/lodash' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/node' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/puppeteer' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/uuid' is in missingTypingsSet - skipping...
[11:6:20.521] '@types/yargs' is in missingTypingsSet - skipping...
[11:6:20.521] Entry for package 'colors' does not exist in local types registry - skipping...
[11:6:20.521] Entry for package 'fermenter' does not exist in local types registry - skipping...
[11:6:20.521] Entry for package 'jest-environment-node' does not exist in local types registry - skipping...
[11:6:20.521] Entry for package 'signal-exit' does not exist in local types registry - skipping...
[11:6:20.521] Entry for package 'tslint-config-temando' does not exist in local types registry - skipping...
[11:6:20.521] Entry for package 'jest-spec-reporter' does not exist in local types registry - skipping...
[11:6:20.521] Entry for package 'make-error' does not exist in local types registry - skipping...
[11:6:20.521] All typings are known to be missing or invalid - no need to install more typings
[11:6:20.521] Sending response:
    {"projectName":"/dev/null/inferredProject1*","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"module":1,"target":3,"jsx":1,"checkJs":true,"allowJs":true,"allowSyntheticDefaultImports":true,"allowNonTsExtensions":true,"noEmitForJsFiles":true},"typings":["/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/aws-sdk/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/bluebird/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/execa/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/fs-extra/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/inquirer/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/jest/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/js-yaml/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/lodash/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/moment/moment.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/puppeteer/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-jest/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/ts-node/dist/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/tslint/lib/index.d.ts","/home/sam/W/TEMANDO/temonodo/tests/suite/node_modules/typescript/lib/typescript.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/uuid/index.d.ts","/home/sam/.cache/typescript/3.2/node_modules/@types/yargs/index.d.ts"],"unresolvedImports":["make-error"],"kind":"action::set"}
[11:6:20.521] Response has been sent.
[11:19:22.360] Parent process has exited, shutting down...

The [11:19:22.360] Parent process has exited, shutting down... is when I manually restarted the TS Server as it was failing to validate my code.

@sheetalkamat
Copy link
Member

Do I need to do anything special apart from cloning repo, opening file and typing the statement mentioned? I followed those steps (with typescript nightly build) but that seem to work as intended. Do not see any process shutdown or crash. Let me know if I need to do something else. If possible please share full tsserver log so we can see where things might be going south. Thanks.

You can enable log level verbose in settigns and open and log and share tsserver and ti log or upload them using

  1. With "typescript.tsserver.log": "verbose" enabled
  2. Restart vscode or vscode insiders
  3. Reproduce the problem
  4. Run code --upload-logs on the command line (or code-insiders --upload-logs if using vscode insiders) and follow instructions
  5. Share the log file ID

@nfour
Copy link
Author

nfour commented Dec 3, 2018

@sheetalkamat

To replicate, by following those steps you should have not have gotten the auto-import suggestion and no auto-fix bubble. Is this the case for you?

The TS Server crashing is intermittent and harder to replicate.

I'll be sure to use that command when it happens again, as verbose is enabled.

@sheetalkamat
Copy link
Member

sheetalkamat commented Dec 3, 2018

To replicate, by following those steps you should have not have gotten the auto-import suggestion and no auto-fix bubble. Is this the case for you?

Yes that's exactly what I saw. (Used typescript@next)

@nfour
Copy link
Author

nfour commented Dec 6, 2018

@sheetalkamat

Uploaded the logs when I noticed that the TS Server was hanging while trying to initialize (going on 5mins now!). VScode is basically unusable with TS:

Upload successful! Log file ID: 134282124

@sheetalkamat
Copy link
Member

@nfour Looking at the log it seems like there are lot of DirectoryWatchers being invoked. Many of them are through failed lookup locations of the sources in project. Is it possible to share the repro project? We can sign nda if needed. (send it to me in email) I would also like to discuss with you about the different directoryWatcher locations that I see and reason about them but I am not sure if your code is private so let me know if we can continue the discussion here on email thread. If email, please contact me at shkamat at microsoft dot com. Thanks.

@nfour
Copy link
Author

nfour commented Dec 10, 2018

@sheetalkamat

We're looking into whether we can share the source :).

I can tell you the project structure is pretty much like this (which you could likely discern from the log outputs I uploaded):

  /services/
    /myService/   // (depends on myLib)
  /libraries/
    /myLib/       // (depends on myLib2) 
    /myLib2/ 
  rush.json

As an alternative, do you think the web-build-tools monorepo is capable of reproducing these issues?

@sandersn sandersn added this to the TypeScript 3.3 milestone Dec 11, 2018
@sheetalkamat
Copy link
Member

@nfour it would be hard to figure out what might be going wrong just from logs. In past we have used source code and figured out if there is something user can do or something we can do to enhance the experience. But that comes from looking at the source code, what kind of things module resolution is looking at etc. So just source structure is not enough (since from the log it seemed module resolution played role in the directory watchers being set). Please let me know once you are ready with the repro code. Thanks.

@sheetalkamat sheetalkamat added Needs More Info The issue still hasn't been fully clarified and removed Needs Investigation This issue needs a team member to investigate its status. labels Dec 13, 2018
@nfour
Copy link
Author

nfour commented Dec 14, 2018

@sheetalkamat I think we'll be able to get you access to the source, will email!

@nfour
Copy link
Author

nfour commented Dec 18, 2018

@sheetalkamat sent you an email requesting info to provide the NDA.

@sheetalkamat
Copy link
Member

@nfour Thanks for email. I am working on getting you the information.

@nfour
Copy link
Author

nfour commented Jan 15, 2019

@sheetalkamat we seem to be having issues getting this NDA underway for various reasons.

Ignoring that, has anyone made progress with this issue in other rush repos at Microsoft?

We are considering a workflow which attempts to use rush for its useful tools and to use something else for linking & installing dependencies.

@sheetalkamat
Copy link
Member

@nfour No we haven't been able to make any progress on this since we are waiting on repro. Have you tried reducing the repro such that you can remove any NDA code and yet reproduce the issue.

@nfour
Copy link
Author

nfour commented Jan 16, 2019

@sheetalkamat working on that now - going to try converting our codebase to use yarn workspaces alongside rush, and to use rush with yarn in another scenario (some node engine incompatibilies when switching over).

That may prove that rush's commons dependency management strategy is where to look.

If you could send the NDA again to my email address that we conversed on I can pass it on to the right people.

@RyanCavanaugh RyanCavanaugh removed this from the TypeScript 3.4.0 milestone Mar 14, 2019
@norman784
Copy link

thanks! feels a bit confusig all the different configurations about how to load modules.

@totomakers
Copy link

totomakers commented Sep 9, 2019

Any update ?

Quick update: Webstorm solve correctly import :)

@RDeluxe
Copy link

RDeluxe commented Sep 11, 2019

I'm sorry, but we have a concrete repo to replicate the issue with, have we not ?

The issue is reproductible on Microsoft own web tools :

https://github.com/Microsoft/web-build-tools

We are trying to switch to Rush + VsCode (both MS products) and we encountered this issue, which is pretty much a showstopper.

Anyway, here is a really small repo to reproduce the issue : https://github.com/RDeluxe/rush-repro-955

Simply go to libraries/dtos/src/dtos/user.ts

You will have a compiler error. Normally vscode should be able to auto import the missing decorators from class-validator

import { IsEmail, IsString, } from 'class-validator'

Or to autocomplete and autoimport while typing IsE.

@RDeluxe
Copy link

RDeluxe commented Sep 18, 2019

Hello, any news ? Could you reproduce on your end ? Thanks !

@RDeluxe
Copy link

RDeluxe commented Oct 9, 2019

I'm sorry to bump this again, is there anything I could do ?

I'm not 100% confident jumping in Typescript's codebase, but if somebody could point me in the right direction I may be able to help.

@csuich2
Copy link

csuich2 commented Feb 10, 2020

Anyone have any workarounds here? Ideally something that doesn't require circumventing the symlinks. I'm still unable to get autocomplete working with a project using Rush.

@totomakers
Copy link

Hi @sheetalkamat

Any news about this issue ?

A small repro is here: https://github.com/RDeluxe/rush-repro-955

Any project with rush + ts look like having the issue

@sheetalkamat
Copy link
Member

The repro provided has nothing to do with rush..
Your tsconfig.json only includes two files and hence there is not auto import suggestion. Duplicate of #28773 where in completion dont have knowledge of symbols that are not part of program

Info 86   [12:31:0.605] Project 'c:/temp/rush-repro-955/libraries/dtos/tsconfig.json' (Configured) 
Info 87   [12:31:0.605] 	Files (40)
	c:/Typescript/built/local/lib.es5.d.ts
	c:/Typescript/built/local/lib.es2015.d.ts
	c:/Typescript/built/local/lib.es2016.d.ts
	c:/Typescript/built/local/lib.es2017.d.ts
	c:/Typescript/built/local/lib.es2018.d.ts
	c:/Typescript/built/local/lib.es2019.d.ts
	c:/Typescript/built/local/lib.es2020.d.ts
	c:/Typescript/built/local/lib.esnext.d.ts
	c:/Typescript/built/local/lib.es2015.core.d.ts
	c:/Typescript/built/local/lib.es2015.collection.d.ts
	c:/Typescript/built/local/lib.es2015.generator.d.ts
	c:/Typescript/built/local/lib.es2015.iterable.d.ts
	c:/Typescript/built/local/lib.es2015.promise.d.ts
	c:/Typescript/built/local/lib.es2015.proxy.d.ts
	c:/Typescript/built/local/lib.es2015.reflect.d.ts
	c:/Typescript/built/local/lib.es2015.symbol.d.ts
	c:/Typescript/built/local/lib.es2015.symbol.wellknown.d.ts
	c:/Typescript/built/local/lib.es2016.array.include.d.ts
	c:/Typescript/built/local/lib.es2017.object.d.ts
	c:/Typescript/built/local/lib.es2017.sharedmemory.d.ts
	c:/Typescript/built/local/lib.es2017.string.d.ts
	c:/Typescript/built/local/lib.es2017.intl.d.ts
	c:/Typescript/built/local/lib.es2017.typedarrays.d.ts
	c:/Typescript/built/local/lib.es2018.asyncgenerator.d.ts
	c:/Typescript/built/local/lib.es2018.asynciterable.d.ts
	c:/Typescript/built/local/lib.es2018.intl.d.ts
	c:/Typescript/built/local/lib.es2018.promise.d.ts
	c:/Typescript/built/local/lib.es2018.regexp.d.ts
	c:/Typescript/built/local/lib.es2019.array.d.ts
	c:/Typescript/built/local/lib.es2019.object.d.ts
	c:/Typescript/built/local/lib.es2019.string.d.ts
	c:/Typescript/built/local/lib.es2019.symbol.d.ts
	c:/Typescript/built/local/lib.es2020.bigint.d.ts
	c:/Typescript/built/local/lib.es2020.promise.d.ts
	c:/Typescript/built/local/lib.es2020.string.d.ts
	c:/Typescript/built/local/lib.es2020.symbol.wellknown.d.ts
	c:/Typescript/built/local/lib.esnext.intl.d.ts
	c:/Typescript/built/local/lib.esnext.string.d.ts
	c:/temp/rush-repro-955/libraries/dtos/src/dtos/user.ts
	c:/temp/rush-repro-955/libraries/dtos/src/index.ts

@totomakers
Copy link

totomakers commented Mar 10, 2020

Hey ! sorry for bothering you @sheetalkamat :(

I made a better repro here: https://github.com/totomakers/rush-example

Maybe i can give you better information for helping you.

  • sample-app is a NestJS project, fresh install.

Normally, VScode provide me help for finding import, like the decorator @Controller

 app controller ts - sample-app - Visual Studio Code

But with rush nothing happen, i (hope) is because of the node_modules folder is not the same as a classic node install.

Issue was provide in Rush, VSCode and Typescript

Maybe i miss the point :'( sorry and thanks for help


tsserver.log

@RDeluxe
Copy link

RDeluxe commented Mar 10, 2020

Hello @sheetalkamat ! Thanks for your time.

To be thorough I updated my repo https://github.com/RDeluxe/rush-repro-955

The README should explain everything. There are 3 projects there:

  • A vanille one (auto imports work)
  • Rush + yarn (not working)
  • Rush + pnpm (not working)

@sheetalkamat
Copy link
Member

@RDeluxe Thank you for repro. we will investigate this.

@sheetalkamat sheetalkamat assigned sheetalkamat and unassigned nfour Mar 10, 2020
@sheetalkamat sheetalkamat added Needs Investigation This issue needs a team member to investigate its status. and removed Needs More Info The issue still hasn't been fully clarified labels Mar 10, 2020
@octogonz
Copy link

Very excited for this to get some attention @sheetalkamat! This issue has been open for a lonnnng time.

@sheetalkamat sheetalkamat added Fix Available A PR has been opened for this issue and removed Needs Investigation This issue needs a team member to investigate its status. labels Mar 13, 2020
@sheetalkamat
Copy link
Member

Good news.. i have fix prototype available.. need to polish it and write some tests.. But i will get PR up soon.

sheetalkamat added a commit that referenced this issue Mar 13, 2020
…r that isnt node_modules

Most of the monorepo like scenarios are like this so looking at symlink to decide if file can be imported is essential
Fixes #28689
sheetalkamat added a commit that referenced this issue Mar 16, 2020
…er that isnt node_modules (#37387)

* Add tests that fail because of symlink to non common directory node_modules

* When the imported module is through node_modules and symlink to folder that isnt node_modules
Most of the monorepo like scenarios are like this so looking at symlink to decide if file can be imported is essential
Fixes #28689
@huntye1
Copy link

huntye1 commented Aug 6, 2021

still have this problem...

Good news.. i have fix prototype available.. need to polish it and write some tests.. But i will get PR up soon.

@leohxj
Copy link

leohxj commented Apr 7, 2022

I set public-hoist-pattern for some phantom modules, but vs code not correctly find the modules or its corresponding type declarations.

microsoft/rushstack#3324 (comment)

@dermicus-miclip
Copy link

For those still searching, make sure that you have vscode installed with the WSL plugin. You must be sure that the WSL backend is used!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects")
Projects
None yet