Skip to content

Align React with scalajs-react 4.0.0 (fixes crash after login) - #11

Merged
rleibman merged 1 commit into
mainfrom
react19-align
Sep 10, 2026
Merged

rleibman merged 1 commit into
mainfrom
react19-align

Conversation

@rleibman

Copy link
Copy Markdown
Owner

Problem

After logging in, the app crashed with TypeError: V is not a function inside react-dom.production.min.js.

zio-auth 3.1.7 pulls in scalajs-react 4.0.0, which is written for React 19. build.sbt asked for 3.0.0, but the VersionScheme.Always schemes let 4.0.0 win silently. Meanwhile web/package.json still installed React 18.3.1. meal-o-rama, dmscreen and jorlan are already on React 19 with scalajs-react 4.0.0; chuti was the only one mismatched.

Changes

  • web/package.json: React and react-dom ^19.2.0 (resolves to 19.3.0). Adds npm overrides, because semantic-ui-react 2.1.5, the latest release, still declares a React <= 18 peer range.
  • web/react-dom-compat.js (new) plus a resolve.alias in web/vite.config.js: restores ReactDOM.findDOMNode, which React 19 removed and semantic-ui-react's <Ref> (via @fluentui/react-component-ref) still calls. It is the same workaround meal-o-rama uses. react-dom 19.3 still includes the function internally.
  • build.sbt: scalajsReactVersion is now 4.0.0, with a comment that it must move together with package.json. Removes a stale eviction comment.

Testing

  • sbt web/webDist builds. The bundle contains React 19.3.0 and the shim.
  • In headless Chrome, the built login page renders with no React errors.
  • Not tested: the page after login, where the crash was. It needs a real login, so please check it after deploying.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FUquyESPidPbweqpxTG2ge

zio-auth 3.1.7 pulls scalajs-react 4.0.0, which targets React 19, and the
VersionScheme.Always schemes let it silently evict web's 3.0.0 while
web/package.json still installed React 18. The app crashed in React's
commit phase right after login ("TypeError: V is not a function").

- web/package.json: React/react-dom 19, with overrides for semantic-ui-react's
  React <= 18 peer range
- web/react-dom-compat.js + vite alias: restore ReactDOM.findDOMNode, which
  React 19 removed and semantic-ui-react's <Ref> still calls (same shim as
  meal-o-rama)
- build.sbt: scalajsReactVersion 4.0.0, stale eviction comment removed

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FUquyESPidPbweqpxTG2ge
@rleibman
rleibman merged commit 004116b into main Sep 10, 2026
1 check 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.

1 participant