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

Failed converting Markdown. (source is not defined) #373

Closed
dwschmid opened this issue Aug 12, 2021 · 5 comments · Fixed by #374
Closed

Failed converting Markdown. (source is not defined) #373

dwschmid opened this issue Aug 12, 2021 · 5 comments · Fixed by #374
Labels
bug Something isn't working

Comments

@dwschmid
Copy link

Thanks for taking care of #367
I tested the newest release on windows. It manages to make an html with the metadata, but the pdf generation fails and I get

[ INFO ] Converting 1 markdown...
[ WARN ] Insecure local file accessing is enabled for conversion from vshale_langfjellet.md.
[ ERROR ] Failed converting Markdown. (source is not defined)

My call looks like this

marp.exe mydoc.md --pdf --allow-local-files --theme .css\mycss.css --html

Same call using the v1.2 works.

@yhatt yhatt added the bug Something isn't working label Aug 12, 2021
@yhatt
Copy link
Member

yhatt commented Aug 12, 2021

Thank you for your report. This error may be specific on the standalone binary in a release page. We can reproduce it also in macOS:

$ ./marp markdown.md --pdf --allow-local-files
[  INFO ] Converting 1 markdown...
[  WARN ] Insecure local file accessing is enabled for conversion from
          markdown.md.
[ ERROR ] Failed converting Markdown. (source is not defined)

$ npx @marp-team/marp-cli@latest markdown.md --pdf --allow-local-files
Need to install the following packages:
  @marp-team/marp-cli@latest
Ok to proceed? (y) y
[  INFO ] Converting 1 markdown...
[  WARN ] Insecure local file accessing is enabled for conversion from
          markdown.md.
[  INFO ] markdown.md => markdown.pdf

We have to debug a packaged executable made by vercel/pkg.

@dwschmid
Copy link
Author

dwschmid commented Aug 12, 2021 via email

@yhatt
Copy link
Member

yhatt commented Aug 12, 2021

An original stack trace seems to be come from tslib that is bundlded in pdf-lib.

ReferenceError: source is not defined
      at Object.<anonymous> (/snapshot/marp-cli/node_modules/pdf-lib/node_modules/tslib/tslib.js:1:63)
      at Module.<anonymous> (/snapshot/marp-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
      at Module.load (node:internal/modules/cjs/loader:975:32)
      at Function.Module._load (node:internal/modules/cjs/loader:816:12)
      at Module.require (node:internal/modules/cjs/loader:999:19)
      at Module.require (pkg/prelude/bootstrap.js:1676:31)
      at require (/snapshot/marp-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
      at Object.<anonymous> (/snapshot/marp-cli/node_modules/pdf-lib/cjs/index.js:3:15)
      at Module.<anonymous> (/snapshot/marp-cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)

@yhatt
Copy link
Member

yhatt commented Aug 12, 2021

@dwschmid Fixed in v1.3.1!

@dwschmid
Copy link
Author

dwschmid commented Aug 12, 2021 via email

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.

2 participants