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

Intermittent type errors when opening or editing files with typescript 3.7 #34999

Closed
KaelWD opened this issue Nov 8, 2019 · 6 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@KaelWD
Copy link

KaelWD commented Nov 8, 2019

  • VSCode Version: 1.40.0 (and 1.39.2)
  • OS Version: Kubuntu 18.04

Steps to Reproduce:

  1. git clone -b refactor/ts37 https://github.com/vuetifyjs/vuetify.git, run yarn && yarn build, then open it in vscode
  2. Open VTreeView.ts and VtreeViewNode.ts
  3. Reload the window, wait for the language server to start then switch to the other open file
  4. When the errors appear, make a small edit, save the file, then undo it

Video demonstrating the problem
And anotha one

This doesn't seem to occur with ts 3.5 (master branch)

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 8, 2019
@mjbvz mjbvz removed their assignment Nov 8, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Nov 8, 2019

Confirmed with TS 3.8.0-dev.20191105. Does not depend on VS Code version and does not happen with TS 3.6.3

Specific errors are things like:

Property 'search' does not exist on type 'CombinedVueInstance<{ register?: undefined; unregister?: undefined; } & Record<never, any> & Vue & { register: null; unregister: null; } & { themeableProvide: { isDark: boolean; }; } & { appIsDark: boolean; isDark: boolean; themeClasses: object; rootIsDark: boolean; rootThemeClasses: Record<...>; } & { ...; } & Them...'

@AnyhowStep
Copy link
Contributor

AnyhowStep commented Nov 8, 2019

Is this a composite project?

If so, try,
#32028 (comment)

I'm on mobile, so I can't watch the videos.

It's been my experience that the feature in that PR can cause funky type-related errors.

Just looked at that branch from mobile. Doesn't look like a composite project


Does it build successfully with tsc despite errors from tsserver?

It may be tangentially related to,
#32573

#29511

Particularly,

I'm experiencing a problem that I can only think is because TS is "giving up" on resolving the type in the IDE. But it resolves the type correctly during compile time.

I've found that tsserver and tsc can have different ideas of what is valid and what is invalid

Sometimes, an upstream type incorrectly resolving to any can cause weird errors to downstream types.

I see Record<never, any> in @mjbvz 's comment, and it looks very suspicious, like an intermittent max depth error in disguise

@AnyhowStep
Copy link
Contributor

AnyhowStep commented Nov 8, 2019

Okay, I feel like this is probably the most relevant issue,
#33067

In that issue, types keep flipping between resolving correctly and resolving to any. The type resolving to Record<never, any> & T looks like that problem

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Nov 8, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.8.0 milestone Nov 8, 2019
@KaelWD
Copy link
Author

KaelWD commented Nov 9, 2019

Yep, it works fine when you build it. Those related issues look a lot like this other problem I had a while ago, where recursive types worked in vscode but were never in tsc: #23897 (comment)

@sheetalkamat sheetalkamat added Duplicate An existing issue was already created and removed Needs Investigation This issue needs a team member to investigate its status. labels Jan 29, 2020
@sheetalkamat sheetalkamat removed this from the TypeScript 3.8.1 milestone Jan 29, 2020
@sheetalkamat sheetalkamat removed their assignment Jan 29, 2020
@sheetalkamat
Copy link
Member

Duplicate of #23897 where in order of resolution changes the result

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

6 participants