-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
typescript 5.0 and nodenext module resolutions results in vue files not found #2662
Comments
I discussed it with vue team members and the conclusion is that you should use |
Mainly for consistency across my monorepo codebase. It was working previously and no error appears in my editor. Feel like there is just something missing in vue-tsc that was not ported over from the language-server. Mainly using nodenext as I was trying to get all my ts code compiled to ESM (have code not using vite atm, primarly API code). Looks like bundle resolution doesn't enforce extensions to be used everywhere, which I preferred with the nodenext resolution. Guess this probably is a linting rule somewhere if I look for one though. It appears module resolution bundle was first introduced in 5.0, so did this change, or something related cause the issue? |
Tried setting up the eslint rule to cover this case and had mixed results. Is there a specific reason that Node16/Next can't be supported also? If it is just a time factor, I can attempt to look into this if there is any specific area you would recommend looking at. |
I think i more understand the problem now. Typescript changed to ESM which makes the patching of this not work and is basically dead code unless there is a different way to do the patch. Talked about in microsoft/TypeScript#52953 a bit Typescript seems to recommend to do module resolution bundler here, or I just live with .vue.js files. Actually if #3150 is fixed then this would resolve some of the issues I ran into in my previous comment. |
@johnsoncodehk I have a somewhat working version for this I can submit a PR for, but more so wondering if volar wants to take the stance of supporting NodeNext or push everyone to bundler resolution. Lot of inspiration came from svelte language tools, https://github.com/sveltejs/language-tools/blob/9dd59e03d4e5e0e83b5bbfd2aa8331e6bf5cebaa/packages/typescript-plugin/src/module-loader.ts#L199 |
@kalvenschraut Can we close this issue? :) |
Probably, I personally haven't tested with nodenext since I have since switched to bundler resolution so can't confirm it is working now, but my PR should have addressed this issue. |
Original discussion about initial support here
I confirmed was still an issue as of vue-tsc 1.4.
Reproduction here
Also wanted to note that this error does not appear in my editor, only when running vue-tsc.
The text was updated successfully, but these errors were encountered: