Closed drbenn closed 5 months ago
I am also facing a similar issue with Chart.JS 4.4.1 when running Angular 17.0.4
I am also facing a similar issue
I've now ran into this same issue, however, I don't think it's actually a PrimeNG issue.
If you install chart.js via npm i chart.js
, and open the node_modules/chart.js/package.json
it references the main as ./dist/chart.cjs
. However, there is no dist
folder in the package.
If you instead download the tgz
file directly, it does have the dist
directory. I'm not sure why it's being deleted, but this has to be the issue.
Are all of you using Node 20? I am and that's where I'm encountering this issue.
Update I tried older versions of Node as well and it still happens. Very odd.
I change in angular.json to "scripts": [ "../node_modules/chart.js/dist/chart.cjs",
it work fine
En mi caso: "scripts": []. Dado que ya en angular17 no es necesario. Me quedo perfecto muchas gracias.
fixed/closed
Describe the bug
Adding chart.js to now default Angular 17 project with standalone components and SSR according to PrimeNG documentation causes errors. I was thinking it was something akin to errors I was receiving while adding NGXS implementation with Angular 17, having to do with SSR and requiring the providers in app.config.ts and app.config.server.ts because the server is not providing what the client is expecting?
I also installed npm i @types/chart.js
Adding the following to angular.json causes an app breaking error in the browser
Receiving the following error
Upon changing angular.json to the following, non app breaking error occurs, only displaying in vsc terminal
This is the error received
Environment
Reproducer
No response
Angular version
17.0.1
PrimeNG version
17.0.0-beta.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.9.0
Browser(s)
No response
Steps to reproduce the behavior
Add chart.js to angular/PrimeNG project as instructed in PrimeNG docs 17.0.0-beta.1
Expected behavior
PrimeNG Angular17 chart.js integration without errors and app breaking errors