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.

The script lang=ts showing misleading errors in .vue files

See original GitHub issue
  • [ x ] I have searched through existing issues
  • [ x ] I have read through docs
  • [ x ] I have read FAQ

Info

  • Platform: Win
  • Vetur version: 0.22.2
  • VS Code version: 1.38.1

Problem

image

Reproducible Case

Try vue js ts project from scratch using @vue/cli with option typescript and check whether vetur <script lang="ts"> is properly validating model properties, vuex getters and actions.

Also my tsconfig.json looks like this:

{
	"compilerOptions": {
		"target": "es5",
		"module": "esnext",
		"strict": true,
		"jsx": "preserve",
		"importHelpers": true,
		"moduleResolution": "node",
		"experimentalDecorators": true,
		"esModuleInterop": true,
		"allowSyntheticDefaultImports": true,
		"sourceMap": true,
		"allowJs": false,
		"baseUrl": ".",
		"types": ["webpack-env", "jest"],
		"paths": {
			"@/*": ["src/*"]
		},
		"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
	},
	"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"],
	"exclude": ["node_modules"]
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
octrefcommented, Sep 30, 2019

When using lang="ts", you should use export default Vue.extend({...}). Otherwise the error checking might not be accurate.

2reactions
vertic4lcommented, Feb 10, 2020

Or just stop using bullshit like Vuex which encourages you to use magic strings to access a getter of a store. Go for MobX.

And even better: Stop using VueJS. It’s just garbage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript errors when editing old Vue 3 components but not ...
I was able to fix these import errors by upgrading TypeScript from 3.9.3 to 4.4.4: npm install typescript@latest. It seems that Vue 3.2.0 ......
Read more >
I can't figure out how to get TypeScript checking on <script ...
I'm looking to get the error reported in the yarn serve output like other typescript errors are (seemingly everywhere except <script setup lang= ......
Read more >
Vue.js+TypeScript: wrong compiler errors when accesing ...
Vue.js+TypeScript: wrong compiler errors when accesing inherited properties ... <script lang="ts"> import { Component, Prop, Vue } from ...
Read more >
‍♂️ ‍♀️ Vue 3 error with using TypeScript: property X does ...
When I run vue-tsc --noEmit to check TypeScript, I get errors: ... <script lang="ts"> import { defineComponent } from 'vue' export default ...
Read more >
How to use Vue 3 with TypeScript - LogRocket Blog
For each item below, I'll show both the TypeScript and JavaScript-equivalent ... //src/App.vue //Typescript code <script lang="ts"> import ...
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