nystudio107 / generator-craftplugin

generator-craftplugin is a Yeoman generator for Craft CMS plugins
MIT License
73 stars 30 forks source link

Invalid Callback Error When Adding Components #70

Closed kmgdevelopment closed 4 years ago

kmgdevelopment commented 6 years ago

I tried to add a fieldtype to my package so in my terminal I ran the command

yo craftplugin --pluginComponents="fieldtypes"

I got this error:

events.js:167
      throw er; // Unhandled 'error' event
      ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:129:9)
    at Object.writeFile (fs.js:1137:14)
    at child.configuring (/usr/local/lib/node_modules/generator-craftplugin/app/index.js:294:12)
    at /usr/local/lib/node_modules/generator-craftplugin/node_modules/yeoman-generator/lib/base.js:429:16
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
Emitted 'error' event at:
    at /usr/local/lib/node_modules/generator-craftplugin/node_modules/yeoman-generator/lib/base.js:437:14
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
lukepearce commented 6 years ago

I'm seeing the same error. Even on running yo craftplugin

timeverts commented 5 years ago

I'm seeing the same error. Even on running yo craftplugin

Me to!

khalwat commented 4 years ago

Fixed this with writeFileSync() -> https://github.com/nystudio107/generator-craftplugin/commit/3d22216593d84ec809c6087115d5b5eeeb40312e