Skip to content

Fantom: yarn fantom warns of a Haste module naming collision in the tester's build tree, which its Jest config does not ignore #60588

Backlog

Description

@YevheniiKotyrlo

Description

I noticed this as a warning at the top of yarn fantom's output once Fantom's tester was built, before any test result.

Fantom's Jest config takes the root config's testPathIgnorePatterns but not its modulePathIgnorePatterns, and ignores the tester's build tree only for watching (config/jest.config.js L42-L58). Its roots include private/react-native-fantom, so jest-haste-map reads the package.json files under private/react-native-fantom/build/, where Skia's CanvasKit holds two packages named external-typescript-test, and prints a "Haste module naming collision" warning for them. The root config's modulePathIgnorePatterns also ignores <rootDir>/packages/react-native/sdks/hermes/ (jest.config.js L65-L69), which Fantom's config does not take either: in my checkout, which holds a Hermes checkout there, a yarn fantom run printed 17 collisions: the Skia pair, and 16 between two files under packages/react-native/sdks/hermes/.

Steps to reproduce

  1. Clone the reproducer below and run ./fantom/reproduce.sh haste-collisions. It needs only Docker: it clones react/react-native at main, builds Fantom's tester with yarn workspace @react-native/fantom build using Clang and LLD 23.1.3, with two settings the reproducer adds for that Clang (-Wno-error=deprecated-literal-operator, and SKCMS_NO_RUNTIME_CPU_DETECTION for Skia's skcms), and runs yarn fantom on View-itest.js, then runs it again with modulePathIgnorePatterns: [...baseConfig.modulePathIgnorePatterns, '<rootDir>/private/react-native-fantom/build/'] added to Fantom's Jest config.

Expected: no collision warning.

Actual: the first run prints the warning before the test's results, the second, with the line added, prints none, and the script exits 1:

[…]
react-native eb37db0c4448a7d26684a5d8b4027166c13fc3e2, committed 2026-12-05T08:30:53+00:00
[…]
jest-haste-map: Haste module naming collision: external-typescript-test
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/private/react-native-fantom/build/third-party/skia/modules/canvaskit/external_test/typescript_browser/package.json
    * <rootDir>/private/react-native-fantom/build/third-party/skia/modules/canvaskit/external_test/typescript_browser_es6/package.json
[…]
Tests:       260 passed, 260 total
[…]
yarn fantom exited with status 0
== Haste module naming collisions: 1, between these files:
[…]
SUMMARY: Haste module naming collisions yarn fantom prints, each between package.json files in the tester's build tree or Hermes's checkout, which Fantom's Jest config does not ignore: 1; with the tester's build tree and the root config's module paths ignored: 0

React Native Version

main at eb37db0; 0.88.1's Fantom config sets no modulePathIgnorePatterns either

Affected Platforms

Other (please specify): Fantom, yarn fantom

Output of npx @react-native-community/cli info

Not applicable: Fantom runs from a checkout of this repository. The reproducer builds and runs it in the reactnativecommunity/react-native-android image with clang version 23.1.3.

Stacktrace or Logs

[…]
jest-haste-map: Haste module naming collision: external-typescript-test
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/private/react-native-fantom/build/third-party/skia/modules/canvaskit/external_test/typescript_browser/package.json
    * <rootDir>/private/react-native-fantom/build/third-party/skia/modules/canvaskit/external_test/typescript_browser_es6/package.json
[…]

MANDATORY Reproducer

https://github.com/YevheniiKotyrlo/react-native-fantom-reproducer

Screenshots and Videos

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions