laktek / punch

A fun and easy way to build modern websites
http://laktek.github.com/punch
MIT License
1.17k stars 107 forks source link

punch generate crashes #92

Closed smola closed 11 years ago

smola commented 11 years ago

I'm trying to use the default punch site (punch setup punch-test) and the punch-blog boilerplate and both of them crash on punch generate. punch s seems to be working correctly, but punch generate crashes with the following output:

$ punch g
Generating site...
Created /css/site.css
....
/usr/local/lib/node_modules/punch/node_modules/mime/mime.js:81
  var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
                      ^
TypeError: Object 0 has no method 'match'
    at Mime.extension (/usr/local/lib/node_modules/punch/node_modules/mime/mime.js:81:23)
    at Object.module.exports.getExtension (/usr/local/lib/node_modules/punch/lib/utils/path_utils.js:16:23)
    at Object.module.exports.renderPath (/usr/local/lib/node_modules/punch/lib/site_generator.js:157:34)
    at move_to_next_path (/usr/local/lib/node_modules/punch/lib/site_generator.js:188:17)
    at run_generator_hooks (/usr/local/lib/node_modules/punch/lib/site_generator.js:219:12)
    at Object.module.exports.run (/usr/local/lib/node_modules/punch/lib/generator_hooks/console_output.js:13:10)
    at run_generator_hooks (/usr/local/lib/node_modules/punch/lib/site_generator.js:217:27)
    at Object.module.exports.runGeneratorHooks (/usr/local/lib/node_modules/punch/lib/site_generator.js:223:10)
    at /usr/local/lib/node_modules/punch/lib/site_generator.js:189:18
    at store_if_modified (/usr/local/lib/node_modules/punch/lib/site_generator.js:173:12)
    at callback_handler (/usr/local/lib/node_modules/punch/lib/page_renderer.js:218:13)
    at /usr/local/lib/node_modules/punch/lib/page_renderer.js:91:12
    at /usr/local/lib/node_modules/punch/lib/template_handler.js:55:11
    at Object.oncomplete (fs.js:107:15)

Some info about my setup:

$ node --version
v0.10.15
$ punch v
Punch version 0.5.33
matthewhowell commented 11 years ago

I'm running into the same error when using punch g. punch s works fine.

$ node --version
v0.10.15
$ punch -v
Punch version 0.5.33
laktek commented 11 years ago

Taking a look at it. Hang in there!

sp commented 11 years ago

I believe my PR fixes this.

laktek commented 11 years ago

This issue is fixed from version 0.5.34