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

Plugin crashes TypeScript ProjectService in TS 5.3.2+ #254

Open
me4502 opened this issue Feb 7, 2024 · 1 comment
Open

Plugin crashes TypeScript ProjectService in TS 5.3.2+ #254

me4502 opened this issue Feb 7, 2024 · 1 comment
Labels
question Further information is requested

Comments

@me4502
Copy link

me4502 commented Feb 7, 2024

Describe the bug
Upon updating to TS 5.3.2 or 5.3.3, this plugin causes the project service within IDE (VSCode) to error, and also causes TypeScript-ESLint with the EXPERIMENTAL_useProjectService option to also fail due to the project service erroring on creation.

Within IDE this is demonstrated by no type errors being reported, however the first line is underlined with Parsing error: Debug Failure. Expected undefined === 0. as the error.

The same error is printed out for every file when ESLint is run with the project service enabled.

Here's a stacktrace of the issue, using TypeScript 5.3.3,

Error: Debug Failure. Expected undefined === 0. 
    at acquireOrUpdateDocument (/workspace/node_modules/typescript/lib/typescript.js:134451:13)
    at Object.acquireDocumentWithKey (/workspace/node_modules/typescript/lib/typescript.js:134401:14)
    at getOrCreateSourceFileByPath (/workspace/node_modules/typescript/lib/typescript.js:143138:33)
    at Object.getOrCreateSourceFile (/workspace/node_modules/typescript/lib/typescript.js:143117:16)
    at /workspace/node_modules/typescript/lib/typescript.js:143041:44
    at Object.getSourceFileWithCache [as getSourceFile] (/workspace/node_modules/typescript/lib/typescript.js:118827:26)
    at findSourceFileWorker (/workspace/node_modules/typescript/lib/typescript.js:121129:25)
    at findSourceFile (/workspace/node_modules/typescript/lib/typescript.js:121049:22)
    at /workspace/node_modules/typescript/lib/typescript.js:120998:24
    at getSourceFileFromReferenceWorker (/workspace/node_modules/typescript/lib/typescript.js:120967:28)

To Reproduce
Steps to reproduce the behavior:

  1. Install this plugin and TypeScript 5.3.3
  2. Open a TypeScript file in IDE
  3. See error

Alternatively,

  1. Install this plugin and TypeScript 5.3.3, and a TypeScript ESLint setup
  2. Enable EXPERIMENTAL_useProjectService in the parserOptions
  3. Run the linter
  4. See the error. The DEBUG='*' env var allows seeing more in-depth stacktraces when it fails to parse the files

Expected behavior
The plugin should not be causing the project service within TypeScript to fail.

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS 14.4
  • Browser Edge
  • Version 121

Additional context
Add any other context about the problem here.

@mrmckeb
Copy link
Owner

mrmckeb commented Feb 11, 2024

Hi there, I wasn't able to reproduce this in my test project. I updated that project to TS 5.3.3, and then restarted VS Code, and everything was still working as expected.

Are you able to provide a very small reproduction for this?

@mrmckeb mrmckeb added the question Further information is requested label Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants