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

Error in positron-proxy extension initialization after v1.95 upstream merge #5743

Closed
petetronic opened this issue Dec 14, 2024 · 3 comments
Closed
Assignees
Labels
area: core Issues related to Core category. area: proxy Issues related to Positron Proxy category. bug Something isn't working

Comments

@petetronic
Copy link
Collaborator

With the merge of v1.95 upstream, the help service is failing likely due to the following error shown in the extension host output on initializing the positron-proxy extension:

2024-12-14 15:53:07.525 [info] ExtensionService#_doActivateExtension positron.positron-proxy, startup: false, activationEvent: 'onCommand:positronProxy.setHelpProxyServerStyles'
2024-12-14 15:53:07.530 [error] Activating extension positron.positron-proxy failed due to an error:
2024-12-14 15:53:07.530 [error] Error: Cannot find module 'express'
Require stack:
- /Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js
- /Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js
	at Module._resolveFilename (node:internal/modules/cjs/loader:1232:15)
	at n._resolveFilename (node:electron/js2c/utility_init:2:16068)
	at Function.resolveFilename [as _resolveFilename] (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83602:38)
	at Module._load (node:internal/modules/cjs/loader:1058:27)
	at c._load (node:electron/js2c/node_init:2:16955)
	at Module._load (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:86483:25)
	at Function.load (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83589:29)
	at Function.load [as _load] (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:79847:25)
	at Module.require (node:internal/modules/cjs/loader:1318:19)
	at require (node:internal/modules/helpers:179:18)
	at 8064 (/Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:89378)
	at r (/Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:90141)
	at 9915 (/Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:83426)
	at r (/Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:90141)
	at 5256 (/Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:81265)
	at r (/Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:90141)
	at /Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:90181
	at Object.<anonymous> (/Applications/Positron.app/Contents/Resources/app/extensions/positron-proxy/dist/extension.js:2:90287)
	at Module._compile (node:internal/modules/cjs/loader:1484:14)
	at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
	at Module.load (node:internal/modules/cjs/loader:1295:32)
	at Module._load (node:internal/modules/cjs/loader:1111:12)
	at c._load (node:electron/js2c/node_init:2:16955)
	at Module._load (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:86483:25)
	at Function.load (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83589:29)
	at Function.load [as _load] (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:79847:25)
	at Module.require (node:internal/modules/cjs/loader:1318:19)
	at require (node:internal/modules/helpers:179:18)
	at $qKc.xb (file:///Applications/Positron.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83657:11)
	at async Promise.all (index 0)
@petetronic petetronic added bug Something isn't working area: proxy Issues related to Positron Proxy category. area: core Issues related to Core category. labels Dec 14, 2024
@petetronic
Copy link
Collaborator Author

This issue was observed on both macOS and Windows

@jmcphers jmcphers self-assigned this Dec 16, 2024
@jmcphers
Copy link
Collaborator

May be related to this comment about the Yarn => Npm transition from upstream:

// TODO: add prune support based on packagedDependencies to vsce.PackageManager.Npm similar
// to vsce.PackageManager.Yarn.
// A static analysis showed there are no webpack externals that are dependencies of the current
// local extensions so we can use the vsce.PackageManager.None config to ignore dependencies list
// as a temporary workaround.

@juliasilge juliasilge added this to the 2025.01.0 Pre-Release milestone Dec 16, 2024
jmcphers added a commit that referenced this issue Dec 17, 2024
This change fixes the Positron Proxy and Positron-DuckDB
(CSV/TSV/Parquet viewer) extension bundling in release builds. An
upstream change caused dependencies of built-in extensions to be
ignored; this is mostly fine but a couple of our built-in extensions
have third-party dependencies that need to be processed.

The fix is to use the NPM dependency detection strategy on these
specific extensions. We can't just use this strategy on _all_ extensions
since it does not work on extensions that have dependencies that are
externally supplied (which is the case for several Microsoft and
Positron extensions).

Additional fixes:
- Fixes loading the `help.html` file in the Help pane in release builds,
and makes the error visible if we can't.
- Serializes Webpack extension building to avoid running out of file
handles on Windows (`EMFILE`).

Addresses #5742
Addresses #5743



e2e: @:data-explorer

### QA Notes

This problem only reproduces in release builds.
@testlabauto
Copy link
Contributor

Verified Fixed

Positron Version(s) : 2025.01.0-104
OS Version          : OSX

Test scenario(s)

?load from console for R and Python

Link(s) to TestRail test cases run or created:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to Core category. area: proxy Issues related to Positron Proxy category. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants