Web Console does not show Scala sources when using Scala.js 1.x source map
See original GitHub issueHi,
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
-
Set up a simple Scala.js project following https://www.scala-js.org/doc/tutorial/basic/index.html SBT v1.3.7 Scala.js v1.1.0 Scala v2.13.1
-
Modify
TutorialApp.scala
to throw an Exception
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 seeTutorialApp.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 showsThrowables.scala:18
after I refresh the page
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.