Repository navigation
Description
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
- Clone the reproducer below and run
./fantom/reproduce.sh haste-collisions. It needs only Docker: it clonesreact/react-nativeatmain, builds Fantom's tester withyarn workspace @react-native/fantom buildusing Clang and LLD 23.1.3, with two settings the reproducer adds for that Clang (-Wno-error=deprecated-literal-operator, andSKCMS_NO_RUNTIME_CPU_DETECTIONfor Skia's skcms), and runsyarn fantomonView-itest.js, then runs it again withmodulePathIgnorePatterns: [...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
Activity