Couldn't resolve `'types' can only be used in a .ts file. Vetur(8010)`
See original GitHub issueInfo
- Platform: macOS
- Vetur version: 0.21.1
- VS Code version: 1.35.1
Problem
I tried to use Vetur in my project of TypeScript with Nuxt.js. Then, 'types' can only be used in a .ts file. Vetur(8010)
appeared.
However, I found this message didn’t appear when I tried to use Vetur in a project of TypeScript with Vue CLI.
Would you show me how deal with that message when using Vetur in TypeScript with Nuxt.js?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Error: 'types' can only be used in a .ts file - Visual Studio ...
I'm using flow with vscode but had the same problem. I solved it with these steps: Install the extension Flow Language Support.
Read more >Veturで"Type annotations can only be used in TypeScript ...
Couldn't resolve 'types' can only be used in a .ts file. Vetur(8010) #1347. Register as a new user and use Qiita more conveniently....
Read more >how to solve Type annotations can only be used in TypeScript
This video is a solution for a problem caused in react native and react TypeScript. This problem generally occurs while creating ...
Read more >Fixed:Type annotations can only be used in TypeScript files ...
Fixed: Type annotations can only be used in TypeScript files ( 8010 ) on React-Native App.js (VSCode). Watch later. Share. Copy link.
Read more >'import … =' can only be used in TypeScript files |Declaration
'import … =' can only be used in TypeScript files | Unexpected keyword or identifier |Declaration expected solved in visual studio code ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It shouldn’t be appeared if the block is
lang="ts"
. Can you provide a self-contained repro? (pasting .vue file, providing example github repo etc.)My solution was to:
lang="ts"
as an attribute in my script tag (as described above)