Skip to content

Instantly share code, notes, and snippets.

@ksheedlo
Last active August 29, 2015 14:13
Show Gist options
  • Save ksheedlo/674adb24154029e42c74 to your computer and use it in GitHub Desktop.
Save ksheedlo/674adb24154029e42c74 to your computer and use it in GitHub Desktop.
Typescript-require relative paths bug
$ node explode.js
fs.js:427
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory '/Users/ken/typescript-require-min-bug/tmp/tsreq/ship.js'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at runJS (/Users/ken/typescript-require-min-bug/node_modules/typescript-require/index.js:91:20)
at Object.require.extensions..ts (/Users/ken/typescript-require-min-bug/node_modules/typescript-require/index.js:22:3)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/ken/typescript-require-min-bug/test.js:5:1)
at Module._compile (module.js:456:26)
require('typescript-require');
var path = require('path');
require(path.join(process.cwd(), 'test/ship.ts'));
interface Kraken {
sink(vessel: any): void
}
var danger: Kraken = {
sink: (vessel) => {
vessel.sunk = true;
}
};
export = danger;
///<reference path="../src/ship.ts"/>
interface Ship {
sunk: Boolean
}
var failboat: Ship = { sunk: true };
export = failboat;
$ tree
.
|____tsreq
| |____src
| | |____ship.js
| |____test
| | |____ship.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment