TS2307: Cannot find module when pure ESM packages with Vue SFC files
See original GitHub issue{
"name": "test-a",
"version": "1.0.0",
"exports": {
".": "./index.js",
"./components/date-picker": "./components/date-picker/index.vue"
}
}
// GET TS2307 error
import DatePicker from 'test-a/components/date-picker'
Repro case: https://github.com/yoyo930021/volar-pure-esm-project-bug/blob/main/src/app.vue#L17
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
VSCode showing "cannot find module" TS error for .vue import ...
vue extension on the import, I resolved this error by adding typescript shims for vue files. I created a file in typings/sfc.d.ts containing ......
Read more >IDE reports TS2307: Cannot find module error for Vue ...
The workaround is to split declare module and declare global into two separate files. The first declare module is called ambient module, which ......
Read more >TypeScript cannot find module (vue file) when the path is ...
I am trying to import LoginForm.vue from ./resources/scripts/views/auth/LoginForm but TypeScript won't recognize the path.
Read more >Getting started with Vite and Vue 3 | Ninja Squad
This is called a Single File Component, or SFC. The CLI is overall super handy to avoid having to learn and configure all...
Read more >ts2307: cannot find module '*.vue' or its corresponding type ...
I have got a Vue3 project running through Vite and trying to import my Vue3 component files in my App.vue . But instead...
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 Free
Top 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
This is unsafe code. It is broken when package internal changed. It also does not meet the ESM.
It have same problem. They are the temp workrounds.