Closed gabormagyar closed 2 years ago
Describe the bug If more than one typescript nunjucks helpers are added via the -f CLI option the ts-node module is registered twice and causes the second file to be compiled twice. This obviously doesn't work.
-f
ts-node
The offending piece of code is https://github.com/j-d-carmichael/boats/blob/main/src/Template.ts#L295
require('ts-node').register(); is called for each *.ts file, when it should not be called more than once.
require('ts-node').register();
*.ts
To Reproduce boats ... -f a.ts -f b.ts b.ts will get double compiled and produces confusing errors
boats ... -f a.ts -f b.ts
b.ts
Expected behavior No error
Additional context This issue would be fixed if the following issue is fixed in ts-node: https://github.com/TypeStrong/ts-node/issues/1690 https://github.com/TypeStrong/ts-node/issues/409
Thanks for reporting - we'll get it looked at asap
https://github.com/j-d-carmichael/boats/releases/tag/2.31.0 should resolve this issue @gabormagyar
Works perfectly, thanks again for the quick fixes!
Describe the bug If more than one typescript nunjucks helpers are added via the
-f
CLI option thets-node
module is registered twice and causes the second file to be compiled twice. This obviously doesn't work.The offending piece of code is https://github.com/j-d-carmichael/boats/blob/main/src/Template.ts#L295
require('ts-node').register();
is called for each*.ts
file, when it should not be called more than once.To Reproduce
boats ... -f a.ts -f b.ts
b.ts
will get double compiled and produces confusing errorsExpected behavior No error
Additional context This issue would be fixed if the following issue is fixed in ts-node: https://github.com/TypeStrong/ts-node/issues/1690 https://github.com/TypeStrong/ts-node/issues/409