thom4parisot / grunt-crx

Grunt task used to package private Chrome Extensions.
https://npmjs.com/grunt-crx
MIT License
118 stars 21 forks source link

`grunt.task` has no `taskError` property #28

Closed pismute closed 11 years ago

pismute commented 11 years ago

I have got another error:

$ grunt --stack crx
Running "crx:dev" (crx) task
Fatal error: undefined is not a function
TypeError: undefined is not a function
    at .../node_modules/grunt-crx/lib/crx.js:61:19
    at null.<anonymous> (.../node_modules/grunt-crx/node_modules/crx/src/crx.js:39:27)
    at null.<anonymous> (.../node_modules/grunt-crx/node_modules/crx/src/crx.js:112:26)
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

You could get mime:

  1. remove your 'zip' command
  2. git clone https://github.com/pismute/ladybucks.git
  3. cd ladybucks;npm install
  4. grunt --stack

grunt.task has no taskError function. I think we can use this function in test only. I am not sure this problem, but It works.

ps> I have an another question. I have got this error if I installed grunt-crx from npm repository. but I cannot get error if I install from local disk using 'npm link grunt-crx'. I cannot understand why...

Thank you.

thom4parisot commented 11 years ago

Oh it must be a legacy from grunt 0.3 or something in the early grunt 0.4.

grunt.fail.fatal should be better than throwing a pure error.

Could you replace throw new grunt.task.taskError(err); by grunt.fail.fatal(err)?

thom4parisot commented 11 years ago

I fixed it in a697f2fbdda08ca370042d83836b8a3dd55d1534. Let me know if this is causing trouble :-)

pismute commented 11 years ago

Thank you!

Does it still need 'throw new'? grunt.fail.fatal makes grunt shutdowned. Could you tell me why it does?

thom4parisot commented 11 years ago

Yes, it's definitely not needed. I have even not followed my own instructions ;-)