Angular-tree-component: .../node_modules/@types/lodash"' has no exported member 'Cancelable'

Created on 31 Aug 2020  路  5Comments  路  Source: CirclonGroup/angular-tree-component

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

Most helpful comment

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

All 5 comments

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

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

Works for us, thanks!

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?

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

This worked for us.

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicolae536 picture nicolae536  路  5Comments

mmallit picture mmallit  路  5Comments

Shadowlauch picture Shadowlauch  路  5Comments

BrkCoder picture BrkCoder  路  4Comments

hipresario picture hipresario  路  4Comments