maxtaco / coffee-script

IcedCoffeeScript
http://maxtaco.github.com/coffee-script
MIT License
727 stars 58 forks source link

`require` extensien hook broken in 1.6.3-h #100

Closed layerssss closed 10 years ago

layerssss commented 10 years ago

After I upgraded to this new version, I can no longer require a .iced file. (I still can do it in 1.6.3-g)

Is it a change or a bug?

// node main.js
require('iced-coffee-script');
require('./puffant-instaprint');
Error: Cannot find module './puffant-instaprint'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.Module._load (module.js:280:25)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/Users/layerssss/puffant-instaprint/main.js:2:1)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:901:3
maxtaco commented 10 years ago

Oy, this was borked/changed in the mainline CS.

maxtaco commented 10 years ago

So looks like they're changing this. It's now this:

require('iced-coffee-script').register()

I tested it with 1.6.3-i and it works. Sorry about this change, I didn't realize mainly CS made it.

layerssss commented 10 years ago

@maxtaco Thanks. I think it should be a future feature ( for 1.6.4) in mainline CS?

layerssss commented 10 years ago

Thanks, it woks.

maxtaco commented 10 years ago

In the future I will be more careful to only merge from master on releases. In this instance I wound up merging some half-baked stuff. Thanks for your patience and sorry for the break.