← All tasks
javascripttesting-library/react-testing-library #1184Not a task: not reproduced

Type conflicts in testing-library vs react

envgap__testing-library__react-testing-library-1184

01 / FAILURE SIGNATURE

As reported upstream

All the errors are related to type conflicts in react vs testing-library. Almost all of them are error `TS2717`:
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
c1f2957a219ec7e6a6159a57c5d0717655c515cd
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

testing-library/react-testing-library #1184 · read the original issue

- `@testing-library/react` version: 12.1.2

- Testing Framework and version: Jest 27.4.5

- DOM Environment:

jsdom: 16.6.0

react: 17.0.2



### What you did:

My team is not yet ready to upgrade to react 18, but I'd like to keep `@testing-library/react` as up to date as possible, so I'm trying to upgrade from 12.1.2 to 12.1.5. 



### What happened:

```

yarn upgrade @testing-library/react

yarn build



Found 177 errors in 2 files.



Errors  Files

   176  node_modules/@testing-library/react/node_modules/@types/react/index.d.ts:3085

     1  node_modules/@types/react/index.d.ts:3100

```

All the errors are related to type conflicts in react vs testing-library. Almost all of them are error `TS2717`:

```

node_modules/@testing-library/react/node_modules/@types/react/index.d.ts:3273:13 - error TS2717: Subsequent property declarations must have the same type.  Property 'view' must be of type 'SVGProps<SVGViewElement>', but here has type 'SVGProps<SVGViewElement>'.



3273             view: React.SVGProps<SVGViewElement>;

                 ~~~~



  node_modules/@types/react/index.d.ts:3288:13

    3288             view: React.SVGProps<SVGViewElement>;

                     ~~~~

    'view' was also declared here.

```

There is also one duplicate identifier error:

```

node_modules/@types/react/index.d.ts:3100:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.



3100         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>

                  ~~~~~~~~~~~~~~~~~~~~~~~~



  node_modules/@testing-library/react/node_modules/@types/react/index.d.ts:3085:14

    3085         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>

                      ~~~~~~~~~~~~~~~~~~~~~~~~

    'LibraryManagedAttributes' was also declared here.

```



### Problem description:

I expect to be able to upgrade testing-library without type conflicts. 



### Suggested solution:

I am not sure if this issue is a bug within testing-library, or some kind of dependency collision within my setup. I have tried upgrading @types/react but this results in even more errors. 

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]