Skip to content

fix(e2e): pin typescript to prevent eslint-plugin-jest from crashing dev server - #149

Merged
fe-lix- merged 1 commit into
mainfrom
fix/pin-eslint-plugin-jest-e2e
Jul 14, 2026
Merged

fix(e2e): pin typescript to prevent eslint-plugin-jest from crashing dev server#149
fe-lix- merged 1 commit into
mainfrom
fix/pin-eslint-plugin-jest-e2e

Conversation

@fe-lix-

@fe-lix- fe-lix- commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The E2E CI run for [SITES-35203] fix(host-react): prevent GuestUIFrame crash when guest is undefined #148 failed 7/13 tests, all with the same symptom: TestCafe couldn't click any button because a full-viewport #webpack-dev-server-client-overlay iframe (CRA's compile-error overlay) was on top of the page.
  • Root cause: react-scripts' ESLint webpack plugin failed to compile with Environment key "jest/globals" is unknown. Tracing it down: eslint-plugin-jest transitively depends on @typescript-eslint/type-utils@5.62.0, which reads ts.TypeFlags.Any from the typescript package. Nothing in that dependency chain constrains the typescript version (it's an unconstrained/optional peer), so a fresh npm install in e2e/host-app and e2e/guest-app resolves whatever typescript is newest at install time — currently a 7.x release with a changed compiler API — which throws when eslint-plugin-jest's rules load, silently breaking the plugin and failing ESLint's environment resolution.
  • This is non-deterministic by nature (depends on what's newest on the registry at npm install time, since these e2e apps have no committed lockfile), so it can pass locally with a reused node_modules and fail in CI (or on any later fresh install) without any source change.
  • Fix: pin typescript to 5.2.2 (matching the version already used at the repo root) via npm overrides in e2e/host-app/package.json.dist and e2e/guest-app/package.json.dist.

Test plan

  • Reproduced the crash directly: require('eslint-plugin-jest') threw TypeError: Cannot read properties of undefined (reading 'Any') on a truly fresh install (confirmed typescript@7.0.2 was resolved).
  • Applied the typescript override, did a clean rm -rf node_modules + fresh install, confirmed typescript@5.2.2 is resolved and eslint-plugin-jest loads without throwing.
  • npx eslint --print-config now exits 0 with no "unknown environment" error.
  • Full npm run build && npm run test:e2e passes 12/12 on the fresh install (this branch is off main, before the undefined-guest test in [SITES-35203] fix(host-react): prevent GuestUIFrame crash when guest is undefined #148 was added).

🤖 Generated with Claude Code

…dev server

eslint-plugin-jest transitively depends on @typescript-eslint/type-utils@5.62.0,
which reads ts.TypeFlags.Any. Nothing in that dependency chain constrains the
typescript version, so a fresh npm install resolves whatever is newest at
install time (currently a TypeScript 7.x prerelease/major that changed the
compiler API), which throws when eslint-plugin-jest's rules load. This crashes
react-scripts' ESLint webpack plugin ("Environment key \"jest/globals\" is
unknown"), which renders a full-viewport dev-server error overlay that
intercepts every click and fails e2e tests non-deterministically depending on
what was resolved at npm-install time.

Pin typescript to 5.2.2 (matching the version already used at the repo root)
via npm overrides so host-app/guest-app installs are deterministic.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fe-lix-
fe-lix- merged commit 8fd88d6 into main Jul 14, 2026
4 checks passed
@fe-lix-
fe-lix- deleted the fix/pin-eslint-plugin-jest-e2e branch July 14, 2026 07:54
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