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

Unable to activate after update 1.21 update #5

Open
yo1dog opened this issue Mar 20, 2018 · 4 comments
Open

Unable to activate after update 1.21 update #5

yo1dog opened this issue Mar 20, 2018 · 4 comments

Comments

@yo1dog
Copy link

yo1dog commented Mar 20, 2018

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)
@alexdima
Copy link

From microsoft/vscode#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;
}

@siegebell
Copy link
Owner

Oh hey! I was just thinking I would have to abandon this extension and remove the scope feature from prettify-symbols-mode... THANKS!

@yo1dog
Copy link
Author

yo1dog commented Mar 28, 2018

I was just about to post the same: microsoft/vscode#46281 (comment)

@yo1dog
Copy link
Author

yo1dog commented Mar 28, 2018

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.

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

3 participants