Skip to content

TypeScript language features are broken in browser-based IDE on node >= 21 #16753

@pisv

Description

@pisv

Steps to Reproduce:

  1. Use Node.JS version >= 21.

  2. Build and run the browser example:

git clone https://github.com/eclipse-theia/theia \
    && cd theia \
    && npm install \
    && npm run build:browser \
    && npm run download:plugins \
    && npm run start:browser

Start your browser on http://localhost:3000.

  1. Open the Theia repository root folder in the browser-based IDE. (Actually, any project in TypeScript will do, as long as it contains a valid tsconfig.json.)

  2. Open a .ts source file, e.g. preference-string-input.ts.

Observe that:

  • The TypeScript language features provided in the editor are limited to the current file, e.g. suggestions are only shown from the current file and Go to Definition can only jump to a symbol in the current file.

  • The language status item in the status bar indicates that the current file is in partial mode, in which project-wide IntelliSense is unavailable.

  • The Output view for TypeScript shows that semantic TS Server is not being used, as only syntax TS Server has been started:

[Info] Starting TS Server
[Info] Using tsserver from: /.../theia/plugins/vscode.typescript-language-features/extension/deps/typescript/lib/tsserver.js
[Info] <syntax> Forking...
[Info] <syntax> Starting...

Additional Information

Actually, I could not believe my own eyes when I saw it and spent most of the weekend trying to troubleshoot the issue, my first thought being that something should be wrong with my local setup, as I could not find any open issue for it and a problem of this kind could certainly not go unnoticed. Also, I could swear that it worked just fine a while ago. (When I was still using node 20.x, as I understand now.)

Finally, I replaced the downloaded version 1.95.3 of the vscode.typescript-language-features extension with a locally built version from the VS Code main branch, and it fixed the issue for me.

Debugging the extension then revealed that the issue is caused by this code in the older versions of typescript-language-features, which has been fixed in version 1.102.0 by this commit.

For background, see microsoft/vscode#251688 and https://code.visualstudio.com/updates/v1_101#_web-environment-detection.

  • Operating System: all
  • Theia Version: 1.67 and earlier

Metadata

Metadata

Assignees

No one assigned

    Labels

    browserissues specific to the browser use-casebugbugs found in the applicationbuiltinsIssues related to VS Code builtin extensionstypescriptissues related to the typescript language

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions