typescript building error when import .vue file with separate .ts file
See original GitHub issueVersion
3.0.0-beta.6
Reproduction link
https://github.com/troy351/vue-cli-demo
Steps to reproduce
clone the repo, run
npm install
npm run serve
What is expected?
run success
What is actually happening?
error File '/src/components/HelloWorld.vue' is not a module.
in App.vue
use inline script (not put script into a separate file) works fine
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:28 (16 by maintainers)
Top Results From Across the Web
VSCode showing "cannot find module" TS error for .vue import ...
In your project workspace, bring up the command palette with Ctrl + Shift + P (macOS: Cmd + Shift + P). Type built...
Read more >import module error with Vue 2.0 and typescript
I'm using Typescript and Vue JS. The compiler works fine but Pycharm show an error in import : My webpack config:
Read more >How To Use TypeScript with Vue Single File Components
In this tutorial, you will use @vue/cli to generate a new Vue.js 2.0 application with TypeScript and build a Single-File Component (SFC).
Read more >TypeScript unable to locate module (vue file) when trying to ...
It turns out TypeScript will not recognize Vue files without adding the ".vue" extension in the path when importing. I will need to...
Read more >TypeScript - Astro Documentation
You can import .ts and .tsx files in your Astro project, write TypeScript code ... can use a separate script to check for...
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
@shenron add
// @ts-ignore
before eachimport '*.vue'
could be a temporary solution.@posva not exactly the same.
I do have file
shims.d.ts
which declare*.vue
filesand it works like this
but the code below throw an error