joost-de-vries/sbt-typescript

TypeScript compilation fails in Trireme JS engine

VeryBueno opened this issue · 1 comments

When Node is not available, the compilation process falls back to the Rhino based Trireme engine. Somewhere between beta-6 and beta-9, the compilation stopped working. I get the error ReferenceError: "Promise" is not defined.

Relevant excerpt from build log:

[error] ReferenceError: "Promise" is not defined. (<...../project/target/typescript/typescript.js>#183)    at compile (<...../project/target/typescript/typescript.js>:183)
[error]     at <...../project/target/typescript/typescript.js>:152
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:497
[error]     at startup (trireme.js:142)
[error]     at trireme.js:923
[info] 
com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: ReferenceError: "Promise" is not defined. (<...../project/target/typescript/typescript.js>#183)    at compile (<...../project/target/typescript/typescript.js>:183)
    at <...../project/target/typescript/typescript.js>:152
    at module.js:456
    at module.js:474
    at module.js:356
    at module.js:312
    at module.js:497
    at startup (trireme.js:142)
    at trireme.js:923

	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:215)
	at com.typesafe.sbt.jse.SbtJsTask$$anonfun$com$typesafe$sbt$jse$SbtJsTask$$executeJsOnEngine$1.apply(SbtJsTask.scala:187)
	at scala.util.Success$$anonfun$map$1.apply(Try.scala:206)
	at scala.util.Try$.apply(Try.scala:161)
	at scala.util.Success.map(Try.scala:206)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
	at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[error] (web-assets:typescript) com.typesafe.sbt.jse.SbtJsTask$JsTaskFailure: ReferenceError: "Promise" is not defined. (<...../project/target/typescript/typescript.js>#183)    at compile (<...../project/target/typescript/typescript.js>:183)
[error]     at <...../project/target/typescript/typescript.js>:152
[error]     at module.js:456
[error]     at module.js:474
[error]     at module.js:356
[error]     at module.js:312
[error]     at module.js:497
[error]     at startup (trireme.js:142)
[error]     at trireme.js:923

Thank you!

Sorry to respond so late. I was swamped at work.
I included your fix. It's in version 0.3.0-beta.10. Tx man!