todvora / gitbook-plugin-image-captions

Image captions plugin for GitBook
Apache License 2.0
44 stars 18 forks source link

TypeError: Array.prototype.reduce called on null or undefined #7

Closed ghuntley closed 8 years ago

ghuntley commented 8 years ago

Problem

Howdy @todvora - I believe there's something wrong with the version you published a couple hours ago.

Repro

Clone https://github.com/reactiveui/documentation and git reset cf0f22c5cf2c49b91f7453b5bb83010921db2842 - any other commits past this point is where we have disabled the plugin.

Stacktrace

TypeError: Array.prototype.reduce called on null or undefined
TypeError: Array.prototype.reduce called on null or undefined
    at reduce (native)
    at redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:263:21
    at redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:1565:9
    at _fulfilled (redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:834:54)
    at self.promiseDispatch.done (redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:796:13)
    at redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:857:14
    at runSingle (redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:137:13)
    at flush (redacted\oss\rxui-documentation\node_modules\gitbook-plugin-image-captions\node_modules\q\q.js:125:13)
    at nextTickCallbackWith0Args (node.js:433:9)
aschempp commented 8 years ago

I'm having the same issue, probably cased by #6. Unfortunately I'm not familiar with promises, can't help much here :(

todvora commented 8 years ago

Hi guys, thank you for the error report and sorry for my delay. I’ve been for the last two weeks in the wild, offline.

The first thing I just did do is a rollback to the previous, working version. New release is 0.3.3. Could one of you provide some minimized version of book source code, that causes this crash? Maybe as a markdown snippet, so I could extend the test suite and figure it out?

Thank you!

aschempp commented 8 years ago

Thanks! Our books are publicly available at https://github.com/contao/docs Be aware of the several subfolders with individual books.

todvora commented 8 years ago

Hi, I've been able to reproduce this error on books from @aschempp and @ghuntley. It should be fixed now in the release 0.3.4. Could you please later confirm, that everything works ok for you?

@ghuntley: next time you don't have to disable a plugin entirely. It should be enough to specify a version of plugin, that works for you. In this case as "image-captions@0.3.1". This notation comes from gitbook itself and works for every plugin.

Thank you for the bugreport and testing materials!

Regards, Tomas

aschempp commented 8 years ago

Thanks for the fix! The build worked now :-) https://travis-ci.org/contao/docs#L8351

todvora commented 8 years ago

Thanks for the feedback Andreas! Closing this issue now, hopefully is it fixed for @ghuntley too.