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.

Dottydoc fails to read symbol in scalajs project on RC2

See original GitHub issue
[error] -- Error: kernel/js/src/main/scala/cats/effect/kernel/AsyncPlatform.scala:38:8 -
[error] 38 |        p.`then`[Unit](onFulfilled, defined(onRejected))
[error]    |        ^^^^^^^^^^^^^
[error]    |undefined: p.then # -1: TermRef(TermRef(NoPrefix,val p),then) at readTasty

Not very minimized, sorry. Here is the exact line and commit hash: https://github.com/typelevel/cats-effect/blob/dedfedecf843e4272488eeaa71581d64eeb08194/kernel/js/src/main/scala/cats/effect/kernel/AsyncPlatform.scala#L38 This compiles and runs just fine on 2.12, 2.13, RC1, and RC2. However, when I attempt to run sbt doc, it errors here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
VlachJosefcommented, Apr 3, 2021

Same problem is happening in https://github.com/playframework/play-json/pull/590

[error] -- Error: play-json/js/src/main/scala/StaticBinding.scala:118:25 --------------------------------------------------------------------------------------------
[error] 118 |    if (!escapeNonASCII) JSON.stringify(s) else escapeStr(JSON.stringify(s))
[error]     |                         ^^^^^^^^^^^^^^^^
[error]     |undefined: scala.scalajs.js.JSON.stringify # -1: TermRef(TermRef(TermRef(ThisType(TypeRef(NoPrefix,module class scalajs)),object js),JSON),stringify) at readTasty
...
[error] (play-jsonJS / Compile / doc) DottyDoc Compilation Failed

Workaround there was to provide missing argument for JSON.stringify(s, null)

1reaction
griggtcommented, Mar 30, 2021

Without cats-effect:

import scala.scalajs.js.{|, defined, Function1, Promise, Thenable}

trait Foo {
  def bar[A](p: Promise[A]) = {
    val onFulfilled: Function1[A, Unit | Thenable[Unit]] = ???
    val onRejected: Function1[Any, Unit | Thenable[Unit]] = ???
    p.`then`[Unit](onFulfilled, defined(onRejected))
  }
}

Seems to have been working before #11671

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dottydoc fails to read scala.scalajs.js.Promise.then symbol in ...
Yes, we had a problem with documenting scala.js projects on 3.0.2. Take a look at unused options: there's the -scalajs flag which we...
Read more >
Reflection - Scala 3 - EPFL
Using quote reflection will break these guarantees and may fail at macro expansion time, hence additional explicit checks must be done.
Read more >
Linking Errors - Scala.js
Solution. clean the project (or possibly all projects) in your sbt build (or the equivalent operation in other build tools). Retrying after ...
Read more >
Scala.js
Scala.js optimizes your Scala code into highly efficient JavaScript. ... is both fast and small, starting from 45kB gzipped for a full application....
Read more >
Announcing Scala.js 1.0.0-RC1
Add libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.0.0-RC1" in project/plugins.sbt.
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