-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Cannot import Vue file without .vue extension (typescript) #5549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is expected behavior and the linked issue has explained it well. In the next major version, we'll stop supporting extension-less import of single file components at all (currently there's only the type checking error). |
Please see vuejs/vue-cli#5549 (comment) - VUE-CLI no longer supports extension-less imports of SPC's (Single Page Components) - which is now breaking the vue-splide plugin :-(
@sodatea Is this documented somewhere for reference? |
@sodatea Can you confirm that this change is still expected to occur? |
Version
4.4.1
Reproduction link
https://github.com/amcsi/vue-cli-ts-problem-demo
Environment info
Steps to reproduce
Clone the repo.
Run yarn install.
Run
yarn run serve
.What is expected?
It compiles fine without errors.
What is actually happening?
See that there's a TS error: Cannot find module '../views/Home' or its corresponding type declarations.
All I did was remove the .vue extension in the index.tsx's import statement that was there out of the box from vue-cli
import Home from "../views/Home.vue";
to
import Home from "../views/Home";
Screenshot:

Possible related issue:
vuejs/vue#5298 (comment)
The text was updated successfully, but these errors were encountered: