Build fails at Angular Tree component with message "no exported member 'Cancelable'"

3.4k Views Asked by At

I use Angular Tree Component in my project and for the past couple of days, I get the following error while building the Angular application. The issue was resolved after quiet a struggle. I am posting my answer below for the community.

2020-09-02T13:10:19.5809754Z ERROR in node_modules/angular-tree-component/dist/components/tree-viewport.component.d.ts(3,10): error TS2305: Module '"D:/eb/A3322/work/2/s/node_modules/@types/lodash/index"' has no exported member 'Cancelable'.
2020-09-02T13:10:19.5810790Z 
2020-09-02T13:10:19.7050898Z npm ERR! code ELIFECYCLE
2020-09-02T13:10:19.7053154Z npm ERR! errno 1
1

There are 1 best solutions below

1
On BEST ANSWER

The latest version of loadash (4.14.161) has a breaking change. Stick to versions below 161 and things will work. The Angular-tree-component uses lodash internally. I was having a cap on my lodash version which updated the component automatically making it more difficult to find.

Changed "@types/lodash": "^4.14.119",

to "@types/lodash": "4.14.119",