Hi,
I've been trying to make our code compatible with the latest streamline and have run into the following. With streamline 0.10.13 and later, I get an error running
_node test._js
where test._js contains:
require('coffee-script');
require('streamline').register();
require('./mod');
and mod._coffee is a streamlined coffee file found in the same directory.
The error is:
$ node_modules/.bin/_node test._js
module.js:340
throw err;
^
Error: Cannot find module './mod'
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> (/home/psung/test._js:3:1)
[...]
The failure to find the ._coffee file seems to be something specific to the registration order that results from using _node, because if I use regular node and rename test._js to test.js, it works fine.
[Just as background info, we're hoping to use the former pattern with _node since our invocation is actually of this form:
_node path/to/mocha path/to/ourtests._js
where mocha is third-party (non-streamlined) JS code that we were hoping could just transparently execute our streamline modules.]
This appears to have been a regression introduced between 0.10.12 and 0.10.13. Can anyone suggest a workaround, or is this a bug, or is there an alternative way we should think about doing this entirely?
Thanks for streamline, and thanks in advance for your help.
Phil