Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Typescript: IDE reports TS2307: Cannot find module error for Vue components imports #1198

Closed
@wujekbogdan

Description

@wujekbogdan

Version

3.0.0-beta.9

Reproduction link

https://pastebin.com/N5A5uWGv

Steps to reproduce

  • Install Vue with vue-cli,
  • Choose Typescript support
  • Open any file that imports *.vue files

What is expected?

No errors are reported

What is actually happening?

IDE reports TS2307: Cannot find module error for Vue components imports. Imports are higlighted in red.


I've already reported this error here:vuejs/vue-class-component#219 because I thought that it is avue-class-component issue, but it's not. It's a configuration issue.

Putting the followingvue-shim.d.ts declaration file under my ./src directory solves the problem:

declaremodule"*.vue"{importVuefrom"vue";exportdefaultVue;}

vue-components-imports-ts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp