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.

Recent versions of `vue-tsc` show "declared but never read" errors (variables used in styles)

See original GitHub issue

With the latest versions of vue-tsc, I’m seeing errors like this:

src/app/core/layouts/default.vue:302:7 - error TS6133: 'sectionImages' is declared but its value is never read.

302 const sectionImages = computed(() => {
          ~~~~~~~~~~~~~

The styles:

.content {
    background-image: v-bind("sectionImages.logo.image"), v-bind("sectionImages.header.image");
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
johnsoncodehkcommented, Mar 21, 2022

@sapphi-red Yes I’m done like your said, but I hope vue can expose parsed css vars and css module classes text range in future version.

1reaction
johnsoncodehkcommented, Mar 21, 2022

Similar to #1089, will look on @vue/compiler-sfc if it has any available API for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript, disable checks for `declared but its value is ...
If you declare a variable but never use it, TypeScript will not compile, saying '<variable>' is declared but its value is never read...
Read more >
Vue3 & Typescript error: ... is declared but its value is never ...
Try using the Take Over Mode in volar instead using Volar, Vetur and the TypeScript Vue Plugin all at the same time.
Read more >
Using Vue with TypeScript
A type system like TypeScript can detect many common errors via static ... If using SFCs, use the vue-tsc utility for command line...
Read more >
Features
Because Vite targets modern browsers only, it is recommended to use native CSS variables with PostCSS plugins that implement CSSWG drafts (e.g. postcss-nesting) ......
Read more >
TypeScript - Astro Documentation
For example, if you use TypeScript to type your component's props, you'll get an error in your editor if you set a prop...
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