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

Export to anything other than HTML does not work #141

Open
thatAkiraFox opened this issue Sep 7, 2022 · 10 comments
Open

Export to anything other than HTML does not work #141

thatAkiraFox opened this issue Sep 7, 2022 · 10 comments

Comments

@thatAkiraFox
Copy link

Hi, I've noticed that the Right click menu > Export to File > PDF does not work: the message Markdown Export: Initializing... never goes away and no PDF file is generated.

Only HTML export and copy works, everything else doesn't.

I'm using code 1.71.0-2 on Arch Linux with extension version 1.1.1.

Let me know if I can provide further informations, thanks in advance!

@muhammetakalan
Copy link

I'm having the same problem on Arch Linux.

My solution;
Upgrade puppeteer version from ^1.20.0 to ^17.1.2 in package.json file. Then download the dependencies with npm install.

@thatAkiraFox
Copy link
Author

This worked, thanks a lot!

@muhammetakalan
Copy link

You're welcome 😊️

@MarcoBuess
Copy link

MarcoBuess commented Sep 8, 2022

@05akalan57 Mind to share some insight on which package.json has to be edited for the average joe? I found several package.json files inside the extensions directory and am not sure which one I need to edit. My bet is on this section

"dependencies": {
        "clipboardy": "^1.2.3",
        "highlight.js": "^11.3.1",
        "js-yaml": "^3.13.1",
        "markdown-it-abbr": "^1.0.4",
        "markdown-it-attrs": "^3.0.1",
        "markdown-it-checkbox": "^1.1.0",
        "markdown-it-container": "^2.0.0",
        "markdown-it-deflist": "^2.0.3",
        "markdown-it-emoji": "^1.4.0",
        "markdown-it-footnote": "^3.0.1",
        "markdown-it-html5-embed": "^1.0.0",
        "markdown-it-kbd": "^2.0.0",
        "markdown-it-mark": "^2.0.0",
        "markdown-it-multimd-table": "^3.2.0",
        "markdown-it-sub": "^1.0.0",
        "markdown-it-sup": "^1.0.0",
        "markdown-it-table-of-contents": "^0.4.4",
        "markdown-it-underline": "^1.0.1",
        "papaparse": "^5.3.0",
        "puppeteer": "^1.20.0"
},

In \extensions\jebbs.markdown-extended-1.1.1\package.json.

Thanks!

@muhammetakalan
Copy link

muhammetakalan commented Sep 9, 2022

sorry for the delay. Yes you found the correct package.json file. After increasing the puppeter version number, don't forget to download the dependencies with npm install.

@c4tom
Copy link

c4tom commented Sep 13, 2022

I'm having the same problem on Arch Linux.

My solution; Upgrade puppeteer version from ^1.20.0 to ^17.1.2 in package.json file. Then download the dependencies with npm install.

I try this, but...

Version: 1.71.0
Commit: 784b0177c56c607789f9638da7b6bf3230d47a8c
Date: 2022-09-01T07:25:10.472Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-47-generic
Sandboxed: No

/vscode/markdown/jebbs.markdown-extended-1.1.1/package.json
	"dependencies": {
		"clipboardy": "^1.2.3",
		"highlight.js": "^11.3.1",
		"js-yaml": "^3.13.1",
		"markdown-it-abbr": "^1.0.4",
		"markdown-it-attrs": "^3.0.1",
		"markdown-it-checkbox": "^1.1.0",
		"markdown-it-container": "^2.0.0",
		"markdown-it-deflist": "^2.0.3",
		"markdown-it-emoji": "^1.4.0",
		"markdown-it-footnote": "^3.0.1",
		"markdown-it-html5-embed": "^1.0.0",
		"markdown-it-kbd": "^2.0.0",
		"markdown-it-mark": "^2.0.0",
		"markdown-it-multimd-table": "^3.2.0",
		"markdown-it-sub": "^1.0.0",
		"markdown-it-sup": "^1.0.0",
		"markdown-it-table-of-contents": "^0.4.4",
		"markdown-it-underline": "^1.0.1",
		"papaparse": "^5.3.0",
		"puppeteer": "^17.1.2"
	},


i.containingImages?.add is not a function
TypeError: i.containingImages?.add is not a function
	at e.renderer.rules.image (/usr/share/code/resources/app/extensions/markdown-language-features/dist/extension.js:1:1713460)
	at s.renderInline (/usr/share/code/resources/app/extensions/markdown-language-features/dist/extension.js:1:1266874)
	at s.render (/usr/share/code/resources/app/extensions/markdown-language-features/dist/extension.js:1:1267278)
	at e.renderer.render (/disco1TB/dados/vscode/markdown/bierner.markdown-mermaid-1.15.2/dist/index.js:1:3406)
	at S.render (/usr/share/code/resources/app/extensions/markdown-language-features/dist/extension.js:1:1260788)
	at renderHTML (/disco1TB/dados/vscode/markdown/jebbs.markdown-extended-1.1.1/out/src/services/exporter/shared.js:42:40)
	at Object.renderPage (/disco1TB/dados/vscode/markdown/jebbs.markdown-extended-1.1.1/out/src/services/exporter/shared.js:26:16)
	at PuppeteerExporter.<anonymous> (/disco1TB/dados/vscode/markdown/jebbs.markdown-extended-1.1.1/out/src/services/exporter/puppeteer.js:61:33)
	at Generator.next (<anonymous>)
	at fulfilled (/disco1TB/dados/vscode/markdown/jebbs.markdown-extended-1.1.1/out/src/services/exporter/puppeteer.js:4:58)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

@muhammetakalan
Copy link

Unfortunately I couldn't find a solution for this problem. 😔️

My own solution is not using images in your markdown file 😅️

@qjebbs
Copy link
Owner

qjebbs commented Sep 14, 2022

v1.1.2 should fix this

@Morikko
Copy link

Morikko commented Sep 14, 2022

In 1.1.2, Markdown Export: Initializing... is not pending any more and I successfully exported a markdown with images to PDF. Thank you a lot.

@thatAkiraFox
Copy link
Author

I decided to do a clean install of the extension before updating, meaning that I uninstalled the extension withing VSCode, then closed it and:

rm -rf .vscode-oss/extensions/jebbs.markdown-extended-1.1.*

Then I re-opened VSCode and reinstalled the extension, but there's another issue now: when I try to generate a PDF file the extension asks to download Chromium and accepting the change yelds this error:

Cannot read properties of undefined (reading 'chromium_revision')
TypeError: Cannot read properties of undefined (reading 'chromium_revision')
	at PuppeteerExporter.<anonymous> (/home/akira/.vscode-oss/extensions/jebbs.markdown-extended-1.1.2/out/src/services/exporter/puppeteer.js:101:138)
	at Generator.next (<anonymous>)
	at /home/akira/.vscode-oss/extensions/jebbs.markdown-extended-1.1.2/out/src/services/exporter/puppeteer.js:8:71
	at new Promise (<anonymous>)
	at __awaiter (/home/akira/.vscode-oss/extensions/jebbs.markdown-extended-1.1.2/out/src/services/exporter/puppeteer.js:4:12)
	at PuppeteerExporter.fetchBinary (/home/akira/.vscode-oss/extensions/jebbs.markdown-extended-1.1.2/out/src/services/exporter/puppeteer.js:98:16)
	at PuppeteerExporter.<anonymous> (/home/akira/.vscode-oss/extensions/jebbs.markdown-extended-1.1.2/out/src/services/exporter/puppeteer.js:30:32)
	at Generator.next (<anonymous>)
	at fulfilled (/home/akira/.vscode-oss/extensions/jebbs.markdown-extended-1.1.2/out/src/services/exporter/puppeteer.js:5:58)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

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

6 participants