carbon-design-system / carbon-charts

:bar_chart: :chart_with_upwards_trend:⠀Robust dataviz framework implemented using D3 & typescript
https://charts.carbondesignsystem.com
Apache License 2.0
904 stars 183 forks source link

[Bug]: The target entry-point "@carbon/charts-angular" has missing dependencies on ng build #1650

Closed LluviaAlvarado closed 1 year ago

LluviaAlvarado commented 1 year ago

Name

Lluvia Alvarado

Are you an IBM employee?

What happened?

When running the ng build with the following command: NODE_OPTIONS="--max-old-space-size=8192" ng build -c local --watch the build fails with this error:

Error: The target entry-point "@carbon/charts-angular" has missing dependencies:
 - @carbon/charts/components/diagrams/buildPaths
 - @carbon/charts/components/diagrams/markerDefinitions

my package.json:

{
  "name": "codegen3",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve -c local",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^13.3.11",
    "@angular/cdk": "^13.3.9",
    "@angular/cli": "^13.3.11",
    "@angular/common": "^13.3.11",
    "@angular/compiler": "^13.3.11",
    "@angular/core": "^13.3.11",
    "@angular/forms": "^13.3.11",
    "@angular/localize": "^13.3.11",
    "@angular/material": "^13.3.9",
    "@angular/platform-browser": "^13.3.11",
    "@angular/platform-browser-dynamic": "^13.3.11",
    "@angular/platform-server": "^13.3.11",
    "@angular/router": "^13.3.11",
    "@carbon/charts-angular": "^1.8.0",
    "@carbon/icons": "^11.24.0",
    "@carbon/styles": "^1.35.0",
    "@fortawesome/angular-fontawesome": "^0.10.2",
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-regular-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@material/list": "^6.0.0",
    "@ng-bootstrap/ng-bootstrap": "^12.1.2",
    "@ng-select/ng-select": "^8.3.0",
    "@ngrx/effects": "^13.2.0",
    "@ngrx/entity": "^13.2.0",
    "@ngrx/store": "^13.2.0",
    "@ngrx/store-devtools": "^13.2.0",
    "@popperjs/core": "^2.11.5",
    "@types/d3": "^7.4.0",
    "ag-grid-angular": "^25.3.0",
    "ag-grid-community": "^25.3.0",
    "angular-archwizard": "^3.0.0",
    "carbon-components-angular": "^5.14.3",
    "core-js": "^3.32.0",
    "d3": "^7.8.5",
    "file-saver": "^1.3.8",
    "font-awesome": "^4.7.0",
    "make-runnable": "^1.3.8",
    "mocha-junit-reporters": "^1.23.6",
    "moment": "^2.24.0",
    "ng-multiselect-dropdown": "^0.2.10",
    "ng-pipes": "^0.1.5",
    "ngx-bootstrap": "^8.0.0",
    "ngx-editor": "^13.0.0",
    "ngx-progressbar": "^8.0.0",
    "ngx-toastr": "^14.3.0",
    "npm": "^8.15.0",
    "primeng": "^13.3.3",
    "prosemirror-tables": "^1.2.5",
    "rxjs": "^7.5.6",
    "sass": "^1.52.2",
    "sql.js": "^1.3.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.3.7",
    "@angular/compiler-cli": "^13.3.11",
    "@types/jasmine": "~3.6.0",
    "@types/node": "^12.20.54",
    "codelyzer": "^6.0.1",
    "mocha": "^9.0.2",
    "mocha-junit-reporter": "^1.23.3",
    "mocha-multi-reporters": "^1.1.7",
    "mochawesome": "^7.1.3",
    "mochawesome-merge": "^2.0.1",
    "mochawesome-report-generator": "^6.2.0",
    "protractor": "^7.0.0",
    "ts-node": "^10.1.0",
    "typescript": "~4.6.4"
  }
}

Version

"@carbon/charts-angular": "^1.8.0",

Data & options used

No response

Relevant log output

 Generating browser application bundles (phase: setup)...Processing legacy "View Engine" libraries:
- ag-grid-angular [es2015/esm2015] ()
- angular-archwizard [es2015/esm2015] (https://github.com/madoar/angular-archwizard)
- ng-pipes [es2015/esm2015] (https://github.com/a8m/ng-pipes.git)
- ng-multiselect-dropdown [es2015/esm2015] (https://github.com/nileshpatel17/ng-multiselect-dropdown.git)
Encourage the library authors to publish an Ivy distribution.
file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:941
      throw new Error(`The target entry-point "${invalidTarget.entryPoint.name}" has missing dependencies:
            ^

Error: The target entry-point "@carbon/charts-angular" has missing dependencies:
 - @carbon/charts/components/diagrams/buildPaths
 - @carbon/charts/components/diagrams/markerDefinitions

    at TargetedEntryPointFinder.findEntryPoints (file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:941:13)
    at file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1264:33
    at SingleProcessExecutorSync.doExecute (file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1573:23)
    at file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1594:35
    at SyncLocker.lock (file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1765:14)
    at SingleProcessExecutorSync.execute (file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:1594:19)
    at mainNgcc (file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/chunk-NALI3EFD.js:2103:19)
    at Module.process (file:///Users/yuge/Documents/Code/codegen3/src/node_modules/@angular/compiler-cli/bundles/ngcc/index.js:34:10)
    at NgccProcessor.processModule (/Users/yuge/Documents/Code/codegen3/src/node_modules/@ngtools/webpack/src/ngcc_processor.js:171:27)
    at /Users/yuge/Documents/Code/codegen3/src/node_modules/@ngtools/webpack/src/ivy/host.js:150:18
    at /Users/yuge/Documents/Code/codegen3/src/node_modules/@ngtools/webpack/src/ivy/host.js:80:24
    at Array.map (<anonymous>)
    at host.resolveModuleNames (/Users/yuge/Documents/Code/codegen3/src/node_modules/@ngtools/webpack/src/ivy/host.js:78:32)
    at /Users/yuge/Documents/Code/codegen3/src/node_modules/@ngtools/webpack/src/ivy/host.js:79:55
    at Array.map (<anonymous>)
    at host.resolveModuleNames (/Users/yuge/Documents/Code/codegen3/src/node_modules/@ngtools/webpack/src/ivy/host.js:78:32)

Node.js v18.16.0

Codesandbox example

No response

What priority level would this be in your opinion?

P0

theiliad commented 1 year ago

Hi @LluviaAlvarado, could you try @carbon/charts-angular@next and let us know if this issue is resolved there?

nstuyvesant commented 1 year ago

@LluviaAlvarado - if you do move up to @carbon/charts-angular@next, you will need to update to Angular 16.

If you want to stay on the Angular version you have, a quick experiment you can perform...

  1. Open node_modules/@carbon/charts-angular/package.json
  2. Change the dependency on @carbon/charts from ^1.8.0 to ~1.8.0
  3. Save
  4. Run npm install
  5. Retry your scenario

The thinking here is that @carbon/charts-angular is trying to use the latest version of @carbon/charts which might not be 100% compatible so this would force a downgrade.

LluviaAlvarado commented 1 year ago

Hi @nstuyvesant thanks this worked! will try to update to the newest angular too to avoid future issues thanks a lot!

nstuyvesant commented 1 year ago

Thanks for the reply @LluviaAlvarado - glad it helped. @theiliad - can you create a 1.8.0 branch so I can submit a lightweight PR to address the issue for pre-Angular 16 users?

Mutondi commented 1 year ago

Hi, Facing the same issue, this package has broken my project :(. How can we possibly resolve this, i tried the steps above and this opened a bunch of other legacy deps errors

nstuyvesant commented 1 year ago

@Mutondi - what is your Angular version?

theiliad commented 1 year ago

I will close the issue for now, but pls do let us know if the PR linked above did not fix the issue, and we can re-open :)