swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Error compiling with Angular 13 and Yarn 3.2 PnP #1721

Open napei opened 2 years ago

napei commented 2 years ago

Description

Currently receiving errors when trying to compile using Angular 13 and Yarn 3.2 PnP.

ngx-charts version: 20.0.1

Errors

./.yarn/__virtual__/@swimlane-ngx-charts-virtual-f07287554d/0/cache/@swimlane-ngx-charts-npm-20.0.1-dcde534266-145f7c04b8.zip/node_modules/@swimlane/ngx-charts/fesm2015/swimlane-ngx-charts.mjs:16:0-39 - Error: Module not found: Error: Can't resolve 'd3-ease' in 'C:\_p\network-toolbox\.yarn\__virtual__\@swimlane-ngx-charts-virtual-f07287554d\0\cache\@swimlane-ngx-charts-npm-20.0.1-dcde534266-145f7c04b8.zip\node_modules\@swimlane\ngx-charts\fesm2015'

./.yarn/__virtual__/@swimlane-ngx-charts-virtual-f07287554d/0/cache/@swimlane-ngx-charts-npm-20.0.1-dcde534266-145f7c04b8.zip/node_modules/@swimlane/ngx-charts/fesm2015/swimlane-ngx-charts.mjs:17:0-35 - Error: Module not found: Error: Can't resolve 'clone-deep' in 'C:\_p\network-toolbox\.yarn\__virtual__\@swimlane-ngx-charts-virtual-f07287554d\0\cache\@swimlane-ngx-charts-npm-20.0.1-dcde534266-145f7c04b8.zip\node_modules\@swimlane\ngx-charts\fesm2015'

Specifically errors about d3-ease and clone-deep.

On another note, d3-ease is used by d3-brush which has a v3 now which supports modules (https://github.com/d3/d3-brush/releases/tag/v3.0.0) which may or may not make Angular happier. Just food for thought.

Dependeicies which had problems and their dependency tree: image

I'll also note, that I also receive the same errors when using the new pnpm linker instead of the node-modules one.

kek-Sec commented 2 years ago

consider installing the d3 dependencies seperately npm install d3 d3-array d3-brush d3-color d3-force d3-format d3-hierarchy d3-interpolate d3-scale d3-selection d3-shape d3-time-format --save-dev

napei commented 2 years ago

consider installing the d3 dependencies seperately npm install d3 d3-array d3-brush d3-color d3-force d3-format d3-hierarchy d3-interpolate d3-scale d3-selection d3-shape d3-time-format --save-dev

Firstly, I'm using yarn. This isn't a good option as they will not be resolved by this library as they are not peerDependencies. The same error persists.

gizemay96 commented 2 years ago

I have the same problem with npm. Does anyone have a solution?

maknapp commented 2 years ago

For clone-deep, see #1688.

jlquijada commented 2 years ago

I have the same problem with npm. Does anyone have a solution?

For me the solution has been to stay in version 19.0.1 #1686. They marked this as solved by #1727 but so far it is not included on the current version (20.0.1).