question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web Console does not show Scala sources when using Scala.js 1.x source map

See original GitHub issue

Hi,

It looks like the Scala sources are not shown correctly in the browser’s web console when using Scala.js 1.x source map.

steps

package tutorial.webapp

object TutorialApp {
  def main(args: Array[String]): Unit = {
    println("Hello world!")
    throw new Exception("Tada!")
  }
}
  • run sbt fastOptJS
  • open index-dev.html in Firefox
  • open the Web Console (Tools -> Web Developer -> Web Console)

We can see java.lang.Exception: Tada!, but the source points to scala-js-tutorial-fastopt.js:771:5

expectation

I am expecting the source to be TutorialApp.scala:6:4

notes

The source looks correct when using Scala.js v0.6.32:

  • Update plugins.sbt to use Scala.js 0.6.32
  • sbt clean fastOptJS
  • open index-dev.html and we can see TutorialApp.scala:6:4

I tried with Chrome and it behaves differently:

  • with Scala.js v0.6.32: no issue
  • with Scala.js v1.1.0: the source is TutorialApp.scala:6:4 the first time I open the Web Console, but it shows Throwables.scala:18 after I refresh the page

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
gzm0commented, Nov 24, 2020

I propose to close this as wontfix for now. This will become actionable if we have more solid standards / evidence that Scala.js is doing something wrong. Any objections?

0reactions
vmuniercommented, Nov 24, 2020

I propose to close this as wontfix for now. This will become actionable if we have more solid standards / evidence that Scala.js is doing something wrong. Any objections?

That’s fine by me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mention source map support for Node.js in tutorial #139 - GitHub
@gzm0 I have source-map-support installed, the .map file is generated and the //# sourceMap added to the compiled .js, however I keep ...
Read more >
Basic tutorial - Scala.js
This is a step-by-step tutorial where we start with the setup of a Scala.js sbt project and end up having some user interaction...
Read more >
scala-js/scala-js - Gitter
Hi all, I'm trying to cross compile a small project (only 1 scala file), I was able to compile and test on main.html,...
Read more >
use scalajs source maps in Google Chrome - Stack Overflow
I just ran into this issue and the part that confused me is that the wording leads to to look for where Chrome...
Read more >
Issue with Scala.js documentation
sbt:Scala.js Tutorial> run [warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found