0

It was all working ok, then everything changed when I updated yarn. I get this error in the yarn server terminal window: Failed to compile. ./node_modules/react-overlays/esm/Dropdown.js Attempted import error: 'useUncontrolledProp' is not exported from 'uncontrollable'.

and this in the localhost window thing: ./node_modules/react-overlays/esm/Dropdown.js Attempted import error: 'useUncontrolledProp' is not exported from 'uncontrollable'.

I just am lost when it comes to those node modules, and could really use some direction in navigating this unfortunate situation.

CoryCoolguy
  • 1,065
  • 8
  • 18
Charley
  • 15
  • 3

1 Answers1

2

In my case, the problem seems to be related to react-bootstrap requiring uncontrollable==^7.0.0 and yarn installing that exact version.

I've fixed it by:

  1. yarn add uncontrollable@7.1.1
  2. remove node_modules directory: in my case rmdir /q /s node_modules
  3. edit package.json to add this: { "resolutions": "uncontrollable": "7.1.1" } (don't forget the , if it is not the last item)
  4. yarn (to re-install all packages)

The point 3. prevents dependencies to use other versions of uncontrollable according to: https://stackoverflow.com/a/41082766/1033012 .


Extra info:

Also, if I ran: yarn list uncontrollable between step 1 and 2, output was:

yarn list v1.22.4
warning ..\..\..\..\package.json: No license field
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ react-bootstrap@1.3.0
│  └─ uncontrollable@7.0.0
├─ react-overlays@4.1.0
│  └─ uncontrollable@7.0.0
└─ uncontrollable@7.1.1
Done in 0.90s.

But that was fixed with steps 2 to 4 with leaved system like this: yarn list uncontrollable

yarn list v1.22.4
warning ..\..\..\..\package.json: No license field
warning Filtering by arguments is deprecated. Please use the pattern option instead.
└─ uncontrollable@7.1.1
Done in 0.99s.
tenuki
  • 73
  • 5