asciidoctor / asciidoctor-docbook.js

DocBook converter for Asciidoctor.js
https://asciidoctor.org/
MIT License
7 stars 2 forks source link

TypeError: Cannot set property 'asciimath_available' of undefined #2

Closed thom4parisot closed 6 years ago

thom4parisot commented 6 years ago

I use asciidoctor-docbook.js@1.5.6-rc.1 and I upgraded to asciidoctor.js@1.5.7-rc.1. It seems some internals changed and prevent asciidoctor-docbook.js to work as it used to be:

/Users/oncletom/workspace/nodebook/node_modules/asciidoctor-docbook.js/dist/main.js:52
      def.asciimath_available = nil;
                              ^

TypeError: Cannot set property 'asciimath_available' of undefined
    at /Users/oncletom/workspace/nodebook/node_modules/asciidoctor-docbook.js/dist/main.js:52:31
    at /Users/oncletom/workspace/nodebook/node_modules/asciidoctor-docbook.js/dist/main.js:1063:7
    at Opal.modules.asciidoctor/converter/docbook5 (/Users/oncletom/workspace/nodebook/node_modules/asciidoctor-docbook.js/dist/main.js:1064:5)
    at Object.Opal.load (/Users/oncletom/workspace/nodebook/node_modules/opal-runtime/src/opal.js:2286:7)
    at $Object.Opal.require (/Users/oncletom/workspace/nodebook/node_modules/opal-runtime/src/opal.js:2314:17)
    at /Users/oncletom/workspace/nodebook/node_modules/asciidoctor-docbook.js/dist/main.js:1076:8
    at /Users/oncletom/workspace/nodebook/node_modules/asciidoctor-docbook.js/dist/main.js:1258:3
    at Object.<anonymous> (/Users/oncletom/workspace/nodebook/bin/build.js:14:34)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)

Does it ring a bell? I instanciated the extension with no option.

ggrossetie commented 6 years ago

Hello @oncletom It's most likely a compatibility issue with Opal. When you compile library A with Opal version Y and library B with Opal version X sometimes it's not compatible.

I've just published a new version of this library: https://www.npmjs.com/package/asciidoctor-docbook.js/v/1.5.7-rc.2

Could you please check that this issue is resolved when using Asciidoctor.js 1.5.7-rc.1 with Asciidoctor-DocBook.js 1.5.7-rc.2 (Asciidoctor-DocBook.js 1.5.7-rc.1 was a failure :stuck_out_tongue_winking_eye: ) ?

thom4parisot commented 6 years ago

I confirm it works now.

I understand better where the issue comes from, thanks for taking the time to explain the quirk 👍