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

Cannot export PDF when SwaggerViewer is installed #402

Closed
SF-28 opened this issue Jan 26, 2023 · 5 comments · Fixed by #408
Closed

Cannot export PDF when SwaggerViewer is installed #402

SF-28 opened this issue Jan 26, 2023 · 5 comments · Fixed by #408
Labels
bug Something isn't working

Comments

@SF-28
Copy link

SF-28 commented Jan 26, 2023

Hello.
This issue was resolved and I'm not stuck, but I'll share the info for someone else.

When I tried to export the PDF, I got the following error.

[error] [Extension Host] TypeError: Cannot read properties of undefined (reading 'encrypted')

I opened "window" from the list of outputs to see the error message and it seems to conflict with the Swagger Viewer.

at IncomingMessage.protocol (/Users/xxxxxx/.vscode/extensions/arjun.swagger-viewer-3.1.2/node_modules/express/lib/request.js:307:31)

After uninstalling SwaggerViewer, I can export the PDF.

@yhatt
Copy link
Member

yhatt commented Jan 26, 2023

Related: marp-team/marp#391

Seeing these cases, probably express looks like doing a something prank. Marp for VS Code is using express that is bundled to the extension, and usually it should never be affected from express library in other extensions. However, express or its internal may depend on some shared value or method globally by a some reason.

Potentially conflicted extensions

@ValenTranshuman
Copy link

This does not apply to my Issue because I have neither of the conflicting extensions listed here installed.

Stack Trace:
[Extension Host] TypeError: Cannot read properties of undefined (reading 'encrypted')
at IncomingMessage.protocol (c:\Users\thevi.vscode-insiders\extensions\shyykoserhiy.vscode-spotify-3.2.1\node_modules\express\lib\request.js:307:31)
at Function.values ()
at qe.findClassPath (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\node_modules@marp-team\marp-cli\lib\marp-cli-48291805.js:1:41653)
at qe.resolvePackage (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\node_modules@marp-team\marp-cli\lib\marp-cli-48291805.js:1:41390)
at Function.resolve (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\node_modules@marp-team\marp-cli\lib\marp-cli-48291805.js:1:40772)
at Function.resolveDefaultEngine (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\node_modules@marp-team\marp-cli\lib\marp-cli-48291805.js:1:40887)
at fromArguments (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\node_modules@marp-team\marp-cli\lib\marp-cli-48291805.js:44:64909)
at Jl (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\node_modules@marp-team\marp-cli\lib\marp-cli-48291805.js:44:125649)
at runMarpCli (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\lib\extension.js:3841:919586)
at doExport (c:\Users\thevi.vscode-insiders\extensions\marp-team.marp-vscode-2.4.1\lib\extension.js:3841:922459) (at console. (c:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:96:138842))
T @ workbench.desktop.main.js:sourcemap:90
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1573
N @ workbench.desktop.main.js:sourcemap:1573
M @ workbench.desktop.main.js:sourcemap:1573
H @ workbench.desktop.main.js:sourcemap:1573
G @ workbench.desktop.main.js:sourcemap:1573
(anonymous) @ workbench.desktop.main.js:sourcemap:1573
invoke @ workbench.desktop.main.js:sourcemap:86
deliver @ workbench.desktop.main.js:sourcemap:86
fire @ workbench.desktop.main.js:sourcemap:86
fire @ workbench.desktop.main.js:sourcemap:553
se.onmessage @ workbench.desktop.main.js:sourcemap:1671
workbench.desktop.main.js:sourcemap:747 Failure to export: [TypeError] Cannot read properties of undefined (reading 'encrypted')

@ValenTranshuman
Copy link

Following the Stack Trace, vscode-spotify seemed to be the issue.

Getting rid of the extension resolved my issue.
Please add the extension to your list of known conflicting extensions.

@yhatt
Copy link
Member

yhatt commented Feb 17, 2023

Added ➕

Thanks for sharing the full stack trace too. I could not have reproduced this problem yet so it is going to be helpful to find a root issue.

-> expressjs/express#2994

@yhatt yhatt added the help wanted Extra attention is needed label Feb 17, 2023
@yhatt yhatt removed the help wanted Extra attention is needed label Feb 18, 2023
@yhatt yhatt linked a pull request Feb 19, 2023 that will close this issue
@yhatt
Copy link
Member

yhatt commented Feb 19, 2023

The latest release of Marp CLI v2.4.0 has no longer inspected the detail of express module while exporting (marp-team/marp-cli#503). I've confirmed #408 actually mitigate errors brought by conflicted extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants