Skip to content
eason du edited this page Jun 1, 2023 · 1 revision

Welcome to the idris2-scala3-vscode wiki!

debugging

suggestions from @Nikita

  • Check what EcmaScript language level that execution environment supports, and make sure Scala.js doesn't output anything newer (it has a config for that).

  • Try to take scala library and ExecutionContext out of the picture. Use native JS .then method with your js.Promise in Scala.js instead of .toFuture.

  • Compare the JS code generated by Scala.js and the JS code generated by Typescript. If there are significant differences, try to understand why, and try to remove the difference by adjusting either the Typescript code or the Scala.js code. One of them should either start working or start.

  • Make sure you're getting all errors and exceptions reported to you – check the execution environment's docs to see if it has any special features to that effect (like Node.js has unhandledRejection event, maybe there's other similar stuff). Throw an exception in your code or create a known failed promise to make sure you're seeing those errors somewhere in some console (without you catching those errors explicitly, I mean). I assume there's some dev console where such errors go...

Clone this wiki locally