Skip to content

"Cannot read property 'lastIndexOf' of undefined" error in tsserver.js #43105

Closed
@neoGeneva

Description

Bug Report

🔎 Search Terms

  • lastIndexOf

🕗 Version & Regression Information

  • This is a crash in tsserver.js
  • This happens in 4.2.2, 4.2.3 and next (4.3.0-dev.20210305), but not version 4.1.5
  • node version v14.15.4
  • windows version 20H2

💻 Steps to reproduce

This happens consistently for me in the OmniSharp/omnisharp-vscode repository, when opening a typescript file with 4.2 installed.

  1. git clone https://github.com/OmniSharp/omnisharp-vscode.git
  2. cd omnisharp-vscode
  3. npm install
  4. npm install -g typescript@4.2.2
  5. code .
  6. Configure vscode to use the global ts server (for me this is "typescript.tsdk": "C:\\Users\\phil\\AppData\\Roaming\\npm\\node_modules\\typescript\\lib",)
  7. Restart code
  8. Open the TypeScript output to view errors

🙁 Actual behavior

The TypeScript language server crashes. Attached is a sample log:
tsserver.zip

🙂 Expected behavior

It to not crash.

Related Issues

There's a couple of related issues in vscode repo such as microsoft/vscode#115905

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions