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.

vetur error on "import type" statements

See original GitHub issue

For Typescript users who want to import a type (and signal that they aren’t going to instantiate any objects from the module), it’s nice to be able to import type like this:

...
<script lang="ts">
import type { AxiosError } from 'axios';
...

right now this results in: Cannot find name 'AxiosError'.Vetur(2304)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
yoyo930021commented, Apr 14, 2021

What do you mean, correct syntax ? This is valid, it compiles and runs correctly.

I just omitted the import and export of the Vue component because it is not pertinent in this issue

Oh, sorry. Can you open a new issue? I will take a look.

0reactions
noookcommented, Apr 13, 2021

What do you mean, correct syntax ? This is valid, it compiles and runs correctly.

I just omitted the import and export of the Vue component because it is not pertinent in this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - TypeScript 3.8
TypeScript 3.8 adds a new syntax for type-only imports and exports. ... error! A type-only import can specify a default import or named...
Read more >
Problems with Vue 3.2 <script setup> tag and TypeScript types
I have defined a user prop with a type of User that I imported from the Firebase SDK. This works, but I get...
Read more >
Cannot be compiled under '--isolatedModules' because it is ...
When the isolatedModules option is set to true , all files in your project must be modules (must contain at least 1 import...
Read more >
import module error with Vue 2.0 and typescript
Error comes from typescript language service, not from the IDE; Typescript compiler/service doesn't currently handle .vue files (https://github.
Read more >
How to fix error TS7016: Could not find a declaration file for ...
If you're using TypeScript you might have run into this error before. The second part of the error says: Try `npm install @types/XYZ`...
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