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

[vscode][plugin] some plugin get vscode Module but not found #6407

Closed
502647092 opened this issue Oct 17, 2019 · 2 comments
Closed

[vscode][plugin] some plugin get vscode Module but not found #6407

502647092 opened this issue Oct 17, 2019 · 2 comments
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility

Comments

@502647092
Copy link
Contributor

Description

code from ext formulahendry.vscode-mysql

Global.keytar = getCoreNodeModule(`keytar`);
exports.Global = Global;
/**
 * Returns a node module installed with VSCode, or null if it fails.
 */
function getCoreNodeModule(moduleName) {
    console.log(vscode.env.appRoot)
    try {
        return require(`${vscode.env.appRoot}/node_modules.asar/${moduleName}`);
    }
    catch (err) { }
    try {
        return require(`${vscode.env.appRoot}/node_modules/${moduleName}`);
    }
    catch (err) { }
    return null;
}

it cause plugin can't use
how to fix this problem

Reproduction Steps

OS and Theia version:
Diagnostics:

@akosyakov akosyakov added question user / developer questions vscode issues related to VSCode compatibility bug bugs found in the application and removed question user / developer questions labels Oct 17, 2019
@akosyakov
Copy link
Member

It looks the same as #4935 (comment)

@akosyakov
Copy link
Member

If we do #4935 (comment) then you should be able to add required modules as dependencies to your app to install them under ${vscode.env.appRoot}/node_modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

2 participants