-
Notifications
You must be signed in to change notification settings - Fork 431
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
TS2307: Cannot find module error but the application compiles and runs properly #219
Comments
@HerringtonDarkholme Putting the following declare module "*.vue" {
import Vue from "vue";
export default Vue;
} Your vue-ts-plugin plugin solves the issue as well. BTW, could you explain what's the benefit of using your plugin over a simple module declaration? Is there any reason why I should use it instead of the solution that I've already applied? I'm trying to develop a vue.js template based on FuseBox that anyone can use, so I prefer to keep the dependencies list as short as possible. |
Closing as this is not an issue of |
TS2307: Cannot find module error but the application compiles and runs properly I find another solution for this problem in vscode... |
This is only for vue 2 wth TypeScript. I had the same error, what i did was:
Then it should work. |
I'm trying to set up a TypeScript project with the vue-class-component decorator support.
Everything seems to be fine, the application compiles properly and works fine as well but there's one thing that bothers me.
Code editors (both: WebStorm and Visual Studio Code) complain about the second line of the
index.js
file. The message is:Here's the code:
index.js
App.vue
tsconfig.json
And here's a screenshot as a confirmation :slight_smile:
So why am I having this error and what does it really mean?
...Actually, I know what this error means because I read through the Typescript documentation which says that this error shows up when TypeScript compiler can't resolve a module. But it doesn't seem to make much sense to me. If it couldn't resolve the
App.vue
module then my application wouldn't compile. Am I right?I tried to set
allowSyntheticDefaultImports
totrue
intsconfig.json
, but it doesn't change anything.So I'm a bit lost now. My app compiles and runs, but from what I can see it shouldn't 🙃
PS
I don't know is Github a proper place for such questions... but on the other hand I'm not sure is it a configuration issue or is it a bug in vue-class-component.
I've already created a topic on the Vue.js forum, but nobody responded to it
The text was updated successfully, but these errors were encountered: