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

Lazily loaded modules broke the require option for reveal.js #35

Closed
obilodeau opened this issue Nov 27, 2018 · 1 comment
Closed

Lazily loaded modules broke the require option for reveal.js #35

obilodeau opened this issue Nov 27, 2018 · 1 comment

Comments

@obilodeau
Copy link
Member

Due to the change we introduced in asciidoctor/asciidoctor-reveal.js#219, fixing issue asciidoctor/asciidoctor-reveal.js#205.

stacktrace:

$ ./node_modules/asciidoctor-cli/bin/asciidoctorjs -r asciidoctor-reveal.js -b revealjs -a revealjsdir=node_modules/reveal.js@ presentation.adoc
internal/modules/cjs/loader.js:637
    throw new ERR_INVALID_ARG_TYPE('id', 'string', id);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type object
    at Module.require (internal/modules/cjs/loader.js:637:11)
    at require (internal/modules/cjs/helpers.js:22:18)
    at convertOptions (/home/olivier/src/asciidoc/test-npm/node_modules/asciidoctor-cli/lib/cli.js:35:5)
    at Object.run (/home/olivier/src/asciidoc/test-npm/node_modules/asciidoctor-cli/lib/cli.js:185:19)
    at Object.<anonymous> (/home/olivier/src/asciidoc/test-npm/node_modules/asciidoctor-cli/bin/asciidoctorjs:8:5)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)

This code is unreleased and the breaking behavior will be advertized in asciidoctor-reveal.js'. I just wanted to plug how to use asciidoctor-cli.js in the docs but stumbled upon the issue when testing.

No rush, I can always document using asciidoctorjs cli later. It's nice btw. Since reveal.js is in Javascript, it simplifies deployment greatly. I'll probably start promoting this instead of the ruby back-end to colleagues.

@ggrossetie
Copy link
Member

That's a good point, thanks!
I think the CLI should check if the required library is an object and if this object has a register function. If it's the case then we should call the register function before doing the conversion.

ggrossetie added a commit to ggrossetie/asciidoctor-cli.js that referenced this issue Dec 2, 2018
ggrossetie added a commit to ggrossetie/asciidoctor-cli.js that referenced this issue Apr 6, 2019
ggrossetie added a commit to ggrossetie/asciidoctor-cli.js that referenced this issue Apr 6, 2019
ggrossetie added a commit that referenced this issue Apr 6, 2019
resolves #35 automatically register converter and extension
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

2 participants