-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
Vue language Server is breaking in typescript 5.x #3689
Comments
And I found this in sourcecode vetur/server/src/services/typescriptService/serviceHost.ts Lines 33 to 38 in 96aaa70
Maybe typescript 5.0 got a breaking change. And I debug in vscode and print to console, make confirm this
|
I research the code of Typescript. var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __esm = (fn, res) => function __init() {
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// src/typescript/_namespaces/ts.ts
var ts_exports3 = {};
__export(ts_exports3, {
// ...
createLanguageServiceSourceFile: () => createLanguageServiceSourceFile
}) It use so, The changes below should fix this issue var __export = (target, all) => {
for (var name in all)
- __defProp(target, name, { get: all[name], enumerable: true });
+ __defProp(target, name, { get: all[name], enumerable: true, configurable: true });
}; - (tsModule as any).createLanguageServiceSourceFile = createLanguageServiceSourceFile;
+ Object.defineProperty(tsModule, 'createLanguageServiceSourceFile', { get: () => createLanguageServiceSourceFile, enumerable: true })
- (tsModule as any).updateLanguageServiceSourceFile = updateLanguageServiceSourceFile;
+ Object.defineProperty(tsModule, 'updateLanguageServiceSourceFile', { get: () => updateLanguageServiceSourceFile, enumerable: true }) |
I try to patch the Typescript exports in but I found this doesn't work because tsModule is find from package env. It may use vscode build-in typescript version, while it great then 5.0.0, vetur will crash and unusable
|
parsedConfig = getParsedConfig(tsModule, env.getProjectRoot(), env.getTsConfigPath()); | |
const initialProjectFiles = parsedConfig.fileNames; | |
logger.logDebug( | |
`Initializing ServiceHost with ${initialProjectFiles.length} files: ${JSON.stringify(initialProjectFiles)}` | |
); | |
scriptFileNameSet = new Set(initialProjectFiles); |
initialProjectFiles
is undefined
This can not be fixed with a little patch.
Conclusion
It can not be fix from vscode extension, it should be fix from upstream(Typescript) and then update vetur to typescript@^5.0.0
Rollback your vscode to older version to make it works again
@yoyo930021 This is my investigation. Are you interested in investigating and solving it? The vetur has completely failed to work on my vscode.
I think you can change title for issue. |
Just wanted to confirm that this is reproducible. When using TypeScript 5.x, vetur would hang. Switching back to 4.9.4 fixed it. |
ref: https://github.com/mrmckeb/typescript-plugin-css-modules/pull/211/files |
Vetur relies deeply on this API. |
if I understand correctly, we cannot yet use Vetur with typescript 5.*, is this the current state? |
Anything new on this issue? |
I also wonder if there is a temporary solution to use TypeScript 5 with Vetur since I'm dependent on |
Same probem, I just want to make Vetur works in my vue 2 project .. |
Vetur: Restart VLS
Info
Output
Problem
The loading status in status bar is always loading.
Because the Vue Language Server can not start correctely
Reproducible Case
The text was updated successfully, but these errors were encountered: