angular-tree-component icon indicating copy to clipboard operation
angular-tree-component copied to clipboard

.../node_modules/@types/lodash"' has no exported member 'Cancelable'

Open Luis16287 opened this issue 4 years ago • 5 comments

The configuration of my project is as follows:

  • Angular CLI: 8.0.0
  • Node: 10.13.0
  • npm: 6.4.1
  • rxjs: 6.4.0
  • typescript: 3.4.5
  • webpack: 4.39.2
  • @types/lodash": "~4.14.118
  • lodash": "4.17.12
  • angular-tree-component": "8.0.0 // for Angular 9 or higher you should switch to the @circlon/angular-tree-component
  • Windows 10 x64

ng serve:

ERROR in node_modules/angular-tree-component/dist/components/tree-viewport.component.d.ts:3:10 - error TS2305: Module '"myPath/node_modules/@types/lodash"' has no exported member 'Cancelable'. import { Cancelable } from 'lodash';

I have tried with:

  • Removing node_modules completely and run a clean install
  • Update @types/lodash to 4.14.161
  • Update lodash to 4.17.20
  • Update angular-tree-component to 8.0.2
  • npm i -D @types/lodash from #643

Nothing in #643 helped me

Luis16287 avatar Aug 31 '20 20:08 Luis16287

We have solved this error by setting @types/lodash to 4.14.159, may be you can try this.

zmpo avatar Sep 01 '20 09:09 zmpo

We have solved this error by setting @types/lodash to 4.14.159, may be you can try this.

Works for us, thanks!

faserg1 avatar Sep 01 '20 10:09 faserg1

This issue is due to @types/lodash being a dependency in version 8 up to 8.2.0. This should have been fixed with 8.2.1. I'm not sure what else was done and how risky/time-consuming the switch from 8.0.0 to 8.2.1 is. I checked and we used version 8.3.0 together with Angular 8.0.0 and version 8.4.0 of the tree with Angular 8.2.0.

Do you want a 8.0.6 with this fix as well? One problem is that we can not publish to the old npm name. We would have to publish this under @circlon/angular-tree-component. This probably would also mean republishing everything up to 8.5.6 under the new name so you don't need to switch the package names updating to another 8.x.x version.

Is this something that's wanted/needed? How many can not update the tree to a newer version?

tobiasengelhardt avatar Sep 01 '20 15:09 tobiasengelhardt

We have solved this error by setting @types/lodash to 4.14.159, may be you can try this.

This worked for us.

BasicExp avatar Sep 01 '20 17:09 BasicExp

@tobiasengelhardt Thanks for the reply. At the moment it is a requirement for us to stay in version 8.x.x, it is in our plans to update to angular 9 but not in the short term.

I tried the following configuration

  • Angular CLI: 8.0.0
  • Node: 10.13.0
  • npm: 6.4.1
  • rxjs: 6.4.0
  • typescript: 3.4.5
  • webpack: 4.39.2
  • lodash": "4.17.12 with these changes
  • @types/lodash": "4.14.160
  • angular-tree-component": "8.3.0

And it has worked correctly for me

Luis16287 avatar Sep 02 '20 19:09 Luis16287