keithamus / hbs-cli

A CLI for handlebars
43 stars 26 forks source link

TypeError: glob is not a function #68

Open lemoncrafter opened 1 year ago

lemoncrafter commented 1 year ago

When I run the example like this: hbs --helper ./src/template_helper/**/*.js --data src/data.json src/templates/**/*.hbs --output dist/ I get this error:

TypeError: glob is not a function
    at /home/user/hsb-example/node_modules/glob-promise/lib/index.js:7:5
    at new Promise (<anonymous>)
    at Object.module.exports [as default] (/home/user/hsb-example/node_modules/glob-promise/lib/index.js:6:10)
    at resolveModuleOrGlob$ (/home/user/hsb-example/node_modules/hbs-cli/lib/index.js:64:38)
    at tryCatch (/home/user/hsb-example/node_modules/babel-runtime/regenerator/runtime.js:72:40)
    at Generator.invoke [as _invoke] (/home/user/hsb-example/node_modules/babel-runtime/regenerator/runtime.js:334:22)
    at Generator.prototype.<computed> [as throw] (/home/user/hsb-example/node_modules/babel-runtime/regenerator/runtime.js:105:21)
    at tryCatch (/home/user/hsb-example/node_modules/babel-runtime/regenerator/runtime.js:72:40)
    at invoke (/home/user/hsb-example/node_modules/babel-runtime/regenerator/runtime.js:146:20)
    at /home/user/hsb-example/node_modules/babel-runtime/regenerator/runtime.js:156:13

Do you know what am I doing wrong? I tried the example sometime ago and it worked but suddenly I started getting that error. I any clue would be appreciated, thanks!

keithamus commented 1 year ago

I’m not sure what’s going wrong there, it looks like a dependency is breaking though. This package could definitely be updated to remove the Babel transpiled code which might help uncover the error a bit more clearly.

sjdrc commented 1 year ago

I'm also hitting the exact same error

keithamus commented 1 year ago

I haven't been maintaining this package particularly. I was mostly using it close to a decade ago. I think it's suffering from some bit rot. If anyone would like to take over maintainership, please feel free to send over some PRs and I'll happily merge and pass the maintainer bit over.

dimbleby commented 1 year ago

this can be repaired with

-        "glob-promise": "^1.0.4",
+        "glob-promise": "^6.0.3",
yasammez commented 7 months ago

Any updates on this?

folofse commented 3 months ago

Yep, adding "resolutions": { "glob-promise": "^6.0.3" } to package.json solved the issue for me