Closed HaoZeke closed 6 years ago
Not really surprising TBH.
I've just had a quick look at gulp-metalsmith, correct me if I'm wrong but it's not really a metalsmith plugin, but something that works a bit like metalsmith and has a similar api. I mean it doesn't have metalsmith as a dependency, so when you import ms from 'gulp-metalsmith'
you don't really have a metalsmith instance at all.
debug-ui is unlike most plugins in that it has to modify the metalsmith instance to copy the data after each plugin is run.
As a workaround you might try the report
function instead of patching the ms instance. report
works a bit more like other metalsmith plugins, and doesn't modify the ms instance. No guarantee it will work though.
I'm reluctant to spend any time trying to make this compatible with gulp-metalsmith.
Unfortunately the report plugin didn't work either..
[16:14:10] Failed to load external module @babel/register
[16:14:10] Requiring external module babel-register
[16:14:29] Using gulpfile ~/Github/Pandoc/grimoire/gulpfile.babel.js
[16:14:29] Starting 'metal'...
[16:14:32] 'metal' errored after 2.73 s
[16:14:32] TypeError in plugin 'gulp-metalsmith'
Message:
metalsmith.write is not a function
Details:
domainEmitter: [object Object]
domain: [object Object]
domainThrown: false
Stack:
TypeError: metalsmith.write is not a function
at writeData (/home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-debug-ui/dist/index.js:208:16)
at Ware.<anonymous> (/home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-debug-ui/dist/index.js:106:5)
at Ware.<anonymous> (/home/haozeke/Github/Pandoc/grimoire/node_modules/wrap-fn/index.js:75:16)
at Ware.<anonymous> (/home/haozeke/Github/Pandoc/grimoire/node_modules/wrap-fn/index.js:57:27)
at next (/home/haozeke/Github/Pandoc/grimoire/node_modules/ware/lib/index.js:85:20)
at /home/haozeke/Github/Pandoc/grimoire/node_modules/wrap-fn/index.js:121:18
at /home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/index.js:130:7
at done (/home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/node_modules/async/lib/async.js:132:19)
at /home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/node_modules/async/lib/async.js:32:16
at /home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/index.js:127:9
at /home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/node_modules/async/lib/async.js:122:13
at _each (/home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/node_modules/async/lib/async.js:46:13)
at Object.async.each (/home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/node_modules/async/lib/async.js:121:9)
at Ware.<anonymous> (/home/haozeke/Github/Pandoc/grimoire/node_modules/metalsmith-autotoc/index.js:111:11)
at Ware.<anonymous> (/home/haozeke/Github/Pandoc/grimoire/node_modules/wrap-fn/index.js:45:19)
at next (/home/haozeke/Github/Pandoc/grimoire/node_modules/ware/lib/index.js:85:20)
I do understand it's probably not worth the trouble and effort, I'll refactor my gulpfile to call the metalsmith cli instead..
Though I don't see any information on it working with the json format...
Hi, I have a setup with gulp-metalsmith so I have tried both patching it outside the function and in the function but neither manages to get any output...
The function is