Skip to content

Strip -scalajs from scaladoc invocation - #4431

Merged
Gedochao merged 3 commits into
VirtusLab:mainfrom
halotukozak:fix/scalajs-scaladoc-crash
Aug 19, 2026
Merged

Strip -scalajs from scaladoc invocation#4431
Gedochao merged 3 commits into
VirtusLab:mainfrom
halotukozak:fix/scalajs-scaladoc-crash

Conversation

@halotukozak

@halotukozak halotukozak commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

scaladoc inherits the full project scalacOptions, including -scalajs for Scala.js builds. That flag makes scaladoc run JS backend codegen phases (e.g. JUnitBootstrappers), which crash on otherwise valid code (#3006). The generated doc content is platform-agnostic, so drop the flag before invoking scaladoc.

Fixes #3006)

Checklist

  • tested the solution locally and it works
  • ran the code formatter (scala-cli fmt .)
  • ran scalafix (./mill -i __.fix)
  • ran reference docs auto-generation (./mill -i 'generate-reference-doc[]'.run)

How much have you relied on LLM-based tools in this contribution?

extensively, I've reviewed the output

How was the solution tested?

a new integration test added

Additional notes

Current workaround: https://github.com/halotukozak-com/made/blob/main/.github/workflows/publish.yml

halotukozak and others added 2 commits August 18, 2026 14:32
…rash

scaladoc inherits the full project scalacOptions, including -scalajs for
Scala.js builds. That flag makes scaladoc run JS backend codegen phases
(e.g. JUnitBootstrappers), which crash on otherwise valid code (VirtusLab#3006).
The generated doc content is platform-agnostic, so drop the flag before
invoking scaladoc.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@halotukozak

Copy link
Copy Markdown
Contributor Author

scala-cli doc --native . already works fine, unpatched

Comment thread modules/cli/src/main/scala/scala/cli/commands/doc/Doc.scala Outdated
Makes the workaround from the previous commit visible instead of silent.
@Gedochao
Gedochao merged commit dbf72a3 into VirtusLab:main Aug 19, 2026
83 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scala.js and scaladoc issue with then method

2 participants