Skip to content
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

Volar fails to start in eclipse theia #122

Open
mind-ar opened this issue Dec 30, 2023 · 1 comment
Open

Volar fails to start in eclipse theia #122

mind-ar opened this issue Dec 30, 2023 · 1 comment

Comments

@mind-ar
Copy link

mind-ar commented Dec 30, 2023

Volar fails to start in eclipse theia because cant find typescript module:

Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in

after some investigation, i found that volar is trying to load the typescript module from extensions/node_modules, that seems to be the place where vscode contains this module.

if (vscode.env.appRoot) {
const libPath = path.join(
vscode.env.appRoot.replace(/\\/g, '/'),
'extensions/node_modules/typescript/lib',
);
return {
path: libPath,
version: await getTsVersion(libPath),
isWeb: false,
};
}

there's a workaround, installing the ms-vscode.vscode-typescript-next extensions, that uses extensionPath to find the node_modules folder (i think that extensionPath is empty so it use the node_modules from de theia folder)

const nightly = vscode.extensions.getExtension('ms-vscode.vscode-typescript-next');
if (nightly) {
const libPath = path.join(
nightly.extensionPath.replace(/\\/g, '/'),
'node_modules/typescript/lib',
);
return {
path: libPath,
version: await getTsVersion(libPath),
isWeb: false,
};
}

here's the related issue in theia repo: eclipse-theia/theia#12443

is there any chance to add a fix to this problem (ie, validating that the extensions/node_modules exists)?

Thanks

@remcohaszing
Copy link
Member

Volar needs to be able to load TypeScript. Does Theia provide this in some other way?

Note that crash happens in a fallback mechanism. Typically users set the typescript.tsdk option in their VS Code settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants