diff --git a/.changeset/chilled-taxis-dance.md b/.changeset/chilled-taxis-dance.md new file mode 100644 index 0000000000..e2a5dcecee --- /dev/null +++ b/.changeset/chilled-taxis-dance.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +The check for `react-dom/client` in the Jest configuration will now properly always run from the target directory. diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 36ffd359aa..b979db5177 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -28,7 +28,9 @@ const envOptions = { }; try { - require.resolve('react-dom/client'); + require.resolve('react-dom/client', { + paths: [paths.targetRoot], + }); process.env.HAS_REACT_DOM_CLIENT = true; } catch { /* ignored */