luisalvesmartins / Markdown-Mermaid-Expand-to-PNG

Expand your markdown mermaid tags to PNG and vice versa
MIT License
7 stars 0 forks source link

fix: TypeError: Cannot read property 'getBufferAsync' of undefined #2

Closed petermetz closed 1 year ago

petermetz commented 3 years ago
  1. Install the extension
  2. Create a samples.md file
  3. Paste the markdown contents into samples.md from the documentation of the VSCode extension
  4. Attempt to generate the PNG files from the code using the extension
  5. Crash happens
[2021-07-12 11:56:47.722] [exthost] [info] ExtensionService#_doActivateExtension LuisAlvesMartins.markdown-code-to-png {"startup":false,"extensionId":{"value":"LuisAlvesMartins.markdown-code-to-png","_lower":"luisalvesmartins.markdown-code-to-png"},"activationEvent":"onCommand:markdown-code-to-png.topng"}
[2021-07-12 11:56:47.723] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/****/.vscode/extensions/luisalvesmartins.markdown-code-to-png-1.2.1/out/extension.js
[2021-07-12 11:56:48.325] [exthost] [error] TypeError: Cannot read property 'getBufferAsync' of undefined
    at /home/****/.vscode/extensions/luisalvesmartins.markdown-code-to-png-1.2.1/out/extension.js:59:44
    at Generator.throw (<anonymous>)
    at rejected (/home/****/.vscode/extensions/luisalvesmartins.markdown-code-to-png-1.2.1/out/extension.js:6:65) markdown-code-to-png.topng
[2021-07-12 12:01:15.435] [exthost] [error] TypeError: Cannot read property 'getBufferAsync' of undefined
    at /home/****/.vscode/extensions/luisalvesmartins.markdown-code-to-png-1.2.1/out/extension.js:59:44
    at Generator.throw (<anonymous>)
    at rejected (/home/****/.vscode/extensions/luisalvesmartins.markdown-code-to-png-1.2.1/out/extension.js:6:65) markdown-code-to-png.topng
[2021-07-12 12:02:48.523] [exthost] [info] extension host terminating: renderer closed the socket
luisalvesmartins commented 3 years ago

Hi, can you please try with this markdown below to check if it raises the same error?

A graph:

graph LR
    Start --> Stop
petermetz commented 3 years ago

@luisalvesmartins Same behavior unfortunately

Screenshot from 2021-07-19 11-02-19

luisalvesmartins commented 3 years ago

Are you using CRLF ? or just LF? Can you please ensure you are using CRLF?

On Mon, Jul 19, 2021 at 7:04 PM Peter Somogyvari @.***> wrote:

@luisalvesmartins https://github.com/luisalvesmartins Same behavior unfortunately

[image: Screenshot from 2021-07-19 11-02-19] https://user-images.githubusercontent.com/1583231/126206042-ff38f649-ed19-4756-9efe-53b7e40dab3e.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/luisalvesmartins/Markdown-Mermaid-Expand-to-PNG/issues/2#issuecomment-882749601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE5AENJKZ7OTQUYUYMNO2LTYRSK7ANCNFSM5AHN3L2A .

petermetz commented 3 years ago

@luisalvesmartins Switching to CLRF fixed it. Any chance that the extension could support LF in the future as well?

ArnaudBrun commented 1 year ago

Hello, I'm getting the same issue despite using CRLF, could you help me ?

luisalvesmartins commented 1 year ago

Hello, I'm getting the same issue despite using CRLF, could you help me ?

What is the enconding you are using? Can you please share a sample file to test?

ArnaudBrun commented 1 year ago

I'm using UTF-8 encoding. You'll find attached a sample. Thanks in advance for you help :)

sample.md

luisalvesmartins commented 1 year ago

It worked out of the box:

image

I will do more tests on your file