Skip to content

fix: Rollback jsdom from 27.0.0 to 26.1.0 - #1343

Merged
xerial merged 3 commits into
mainfrom
fix/20250929_112422-rollback-jsdom-upgrade
Sep 29, 2025
Merged

xerial merged 3 commits into
mainfrom
fix/20250929_112422-rollback-jsdom-upgrade

Conversation

@xerial

@xerial xerial commented Sep 29, 2025

Copy link
Copy Markdown
Member

Summary

  • Rollback jsdom from 27.0.0 to 26.1.0 to fix Scala.js test failures
  • jsdom 27.0.0 introduced breaking API change (sendTo() → forwardTo())
  • scala-js-env-jsdom-nodejs 1.1.0 still uses old sendTo() API
  • Fix has been merged upstream but not yet released

Problem

PR #1316 upgraded jsdom from 26.1.0 to 27.0.0, which introduced a breaking change:

  • VirtualConsole.sendTo() was renamed to forwardTo()
  • This causes TypeError: (intermediate value).sendTo is not a function during Scala.js test execution
  • The error occurs because scala-js-env-jsdom-nodejs 1.1.0 (last released May 2020) still uses the old API

Solution

Rollback jsdom to 26.1.0 until scala-js-env-jsdom-nodejs releases a new version with jsdom 27 support.

The fix has been merged in scala-js/scala-js-env-jsdom-nodejs#58 but not yet released.

Test plan

  • Run Scala.js tests locally: ./sbt "langJS/test" - all 486 tests pass
  • CI Scala.js tests should pass

Related Issues

Fixes #1316

🤖 Generated with Claude Code

jsdom 27.0.0 introduced a breaking change where sendTo() was renamed to
forwardTo() in VirtualConsole. This breaks scala-js-env-jsdom-nodejs 1.1.0
which still uses the old sendTo() API, causing TypeError during Scala.js
test execution.

The fix has been merged in scala-js/scala-js-env-jsdom-nodejs#58 but not
yet released. Rollback jsdom to 26.1.0 until a new version of
scala-js-env-jsdom-nodejs is released with jsdom 27 support.

Fixes #1316

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Sep 29, 2025
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @xerial, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a critical dependency rollback to address immediate test failures within the Scala.js environment. By reverting the jsdom library to a previous stable version, it restores compatibility with an unupdated upstream dependency, ensuring the continuous successful execution of Scala.js tests until a permanent fix is released.

Highlights

  • Dependency Rollback: The jsdom dependency has been rolled back from version 27.0.0 to 26.1.0.
  • Fix for Scala.js Tests: This rollback resolves Scala.js test failures caused by a breaking API change in jsdom 27.0.0, specifically the renaming of VirtualConsole.sendTo() to forwardTo().
  • External Dependency Compatibility: The scala-js-env-jsdom-nodejs 1.1.0 library, which is a dependency, still relies on the old sendTo() API, leading to TypeError during test execution with jsdom 27.0.0.
  • Temporary Solution: This change is a temporary measure until scala-js-env-jsdom-nodejs releases a new version that supports jsdom 27.0.0, for which a fix has already been merged upstream but not yet released.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly rolls back jsdom to version 26.1.0 to fix a breaking change introduced in v27.0.0 that was causing Scala.js tests to fail. The change is well-justified and clearly explained. I've added one suggestion to pin the dependency to the exact version for better stability and to prevent any unexpected issues from future patch releases. Overall, this is a solid fix.

Comment thread package.json Outdated
"@rollup/plugin-replace": "^6.0.2",
"autoprefixer": "^10.4.21",
"jsdom": "^27.0.0",
"jsdom": "^26.1.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This is a good fix for the compatibility issue. To ensure future stability and prevent unexpected breakages from minor or patch updates within the 26.x series, it's a good practice to pin the dependency to the exact version that is known to work. This makes dependency resolution more deterministic.

Suggested change
"jsdom": "^26.1.0",
"jsdom": "26.1.0",

xerial and others added 2 commits September 29, 2025 11:29
Add package.json and package-lock.json to CI workflow filters to ensure
Scala.js tests run when npm dependencies are updated. This prevents
breaking changes like the jsdom 27.0.0 upgrade from being merged without
proper testing.

This ensures that dependency upgrades affecting the Scala.js test
environment (like jsdom used by scala-js-env-jsdom-nodejs) are properly
validated by CI before merging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Pin jsdom to exact version 26.1.0 instead of ^26.1.0 to ensure
deterministic dependency resolution and prevent unexpected breakages
from minor or patch updates within the 26.x series.

This addresses Gemini's review feedback for more stable dependency
management.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@xerial
xerial enabled auto-merge (squash) September 29, 2025 18:33
@xerial
xerial merged commit a9c31a2 into main Sep 29, 2025
24 checks passed
@xerial
xerial deleted the fix/20250929_112422-rollback-jsdom-upgrade branch September 29, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant