Unable to activate after update 1.21 update
On startup I get this error in the debug console:
Activating extension `siegebell.scope-info` failed: Cannot find module 'c:\Program Files (x86)\Microsoft VS Code\resources\app\node_modules\vscode-textmate\release\main.js'
extensionHostProcess.js:453
Here is the error stack: Error: Cannot find module 'c:\Program Files (x86)\Microsoft VS Code\resources\app\node_modules\vscode-textmate\release\main.js'
extensionHostProcess.js:453
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Function.J.Y.t.getExtensionPathIndex.then.o._load (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:671:784)
at Module.require (module.js:498:17)
at Module.patchedRequire [as require] (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\git\node_modules\diagnostic-channel\dist\src\patchRequire.js:14:46)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Mike\.vscode\extensions\siegebell.scope-info-0.2.0\out\src\text-mate.js:3:12)
at Object.<anonymous> (C:\Users\Mike\.vscode\extensions\siegebell.scope-info-0.2.0\out\src\text-mate.js:22:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
From https://github.com/Microsoft/vscode/issues/36997
To make your extension entirely compatible with a distribution of VSCode that uses ASAR, and to make your extension work with both VSCode stable and VSCode insiders, you will need to try to load from two paths... Something like the following:
function getNodeModule(moduleName) {
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;
}
Oh hey! I was just thinking I would have to abandon this extension and remove the scope feature from prettify-symbols-mode... THANKS!
I was just about to post the same: https://github.com/Microsoft/vscode/issues/46281#issuecomment-376907056
I was in the middle of developing an extension that relied on scope-info when the update happened so I opened an issue here and on vscode.