question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vue-tsc can not find vue files if module resolution is node12 or nodenext

See original GitHub issue

Reproduction can be found here

I have been trying to migrate my codebase to use typescripts new esm modules and for that I need to use node12 or nodenext module resolution. Everything seems to work fine, but due to typescript needing extensions to correctly resolve files now, it appears vue-tsc is unable to find the vue files anymore. I did notice having vue.js did fix the issue for vue-tsc, but then I can’t build with vite.

I can’t seem to find any other alternative solutions to this problem, maybe I have to change something in my code base?

A possible solution to the problem maybe changing the file import path to vue.js with vue-tsc before calling tsc? If this is the desired direction, and if pointed in the right direction I can take a look at doing a PR.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pwang2commented, Dec 9, 2022

@johnsoncodehk , Takeover mode works for me in Neovim. Thanks! Great work on volar to make everyone’s life better and better. 🙌

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode showing "cannot find module" TS error for .vue import ...
For me, for a Vite & Vue 3 project in PhpStorm it was enough to create a shims file in the src directory....
Read more >
Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
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 >
Why am I getting a bunch of errors TS2532: "Foo is possibly ...
If I remove the vue-tsc -noEmit it does build, but it doesn't seem like all components are generated (e.g, /dist is looking sparse)....
Read more >
Building a Vue3 Typescript Environment with Vite - miyauci.me
In this article, I'll build a Vue3 project environment using Vite. You can find the template in here. Things to do. The goal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found