question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type-checking broken with TypeScript 4.5.x+

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: v0.35.0
  • VS Code version: 1.63.2

Problem

When using workspace dependencies with typescript version 4.5.2 or higher, type checking doesn’t work correctly in the template or script block.

Reproducible Case

  1. Clone https://github.com/rchl/vetur-ts45
  2. Set vetur.useWorkspaceDependencies in VSCode’s User preferences (it’s not available in Workspace preferences).
  3. Open the project and the src/Test.vue file.

The issue exists since typescript v4.5.2. Downgrading to typescript v4.4.4 works as expected. There are no public (stable) versions of typescript in between those.

Result:

Screenshot 2022-01-27 at 18 36 10

Expected

Screenshot 2022-01-27 at 18 36 49

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:16
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
ascott18commented, Apr 9, 2022

Issue is also present with Typescript 4.5.5.

image

For searchability:

  • ‘this’ implicitly has type ‘any’ because it does not have a type annotation. Vetur(2683)
  • Duplicate identifier ‘(Missing)’. Vetur(2300)
  • Cannot find name ‘__vlsRenderHelper’. Vetur(2304)
  • Cannot find name ‘__vlsComponentHelper’. Vetur(2304)
3reactions
mrfycommented, Apr 15, 2022

Same here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - TypeScript 4.5
TypeScript 4.5 supports an ECMAScript proposal for import assertions. This is a syntax used by runtimes to make sure that an import has...
Read more >
Documentation - Type Checking JavaScript Files - TypeScript
Here are some notable differences on how checking works in .js files compared to .ts files. Properties are inferred from assignments in class...
Read more >
Documentation - TypeScript 4.4
Instead of having to convince TypeScript of a variable's type whenever we use it, the type-checker leverages something called control flow analysis to...
Read more >
Documentation - TypeScript 4.7
Around TypeScript 4.5 we rolled out nightly-only support for ESM in Node.js ... By default, TypeScript overlays the same rules with import conditions...
Read more >
Documentation - The Basics - TypeScript
If we break this down, the first runnable line of code accesses a property ... the way that our JavaScript runtime chooses what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found