Skip to content

dgoldstein0/typescript-plugin-bug-repro

Repository files navigation

typescript-plugin-bug-repro

This repo exists to show a bug in the combination of tsserver, typescript-plugin-css-modules, and typescript-plugin-yaml. The latter is taken from https://github.com/rickdgeerling/typescript-plugin-yaml/tree/feat/support-ts-v5; as there is no published copy with the TS 5.0 fix, I could use, I had to copy the compiled outputs into this repo. Interestingly, that repo basically copies the approach of typescript-plugin-css-modules.

Basically, the bug: if you open index.ts in any typescript-supporting IDE - VSCode works, as does VIM with the tsuquyomi plugin - then one of the two imports won't resolve - corresponding to whichever plugin is currently specified first in tsconfig.json.

After a lot of logging in the two plugins and reading tsserver logs, my only real conclusion is that while typescript initializes both plugins, it just chooses not to use one of them. My guess is that it's only using the last returned languageService - I've included my logging of the typescript-plugin-css-modules and it's pretty clear from the lack of those firing that after plugin initialization in tsserver, tsserver just doesn't use the plugin. That said, I've also seen some other cases where each plugin seems to work despite both being configured, so possibly there's something racy about plugin initialization.

About

a repo with a minimal reproduction of a tsserver bug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published