Bar Chart type Column not working on production build

I'm having this weird issue where a Bar Chart using columns works fine when debugging, but on a production build it breaks the whole page and throws the javascript errors below:
image

I already tried the same data using bars, line and area and it works fine.
I also tried the columns chart with different data that was working with bars, and it still doesn't work.

Another detail: when I have a column chart on the page, the browser doesn't even fetch the data from server.

We cannot reproduce this issue. If you own a Radzen Professional subscription you can send us your project to info@radzen.com and we will troubleshoot.

I just created a new clean app with only one blank page and a column chart without any binding data.
Running in debug mode it works (doesn't break the app), running the production build doesn't work, it breaks the app (menu doesn't show and the page throws javascript errors).

Another detail I just noticed, in the toolbox I have available the Area, Bar and Line charts, but not the Column Chart. Is this normal?

image

We are having exact same issue with production build.

I also note that if I manually navigate to a route that doesn't have the bar chart on it, and then back again via angular routes, the issue self-resolves.

We are professional subscribers and this is preventing production release.

I just found a workaround, but I'm not sure the impact of it.
I switched the "buildOptimizer" flag to false on the file "angular.json". However it requires manual build because Radzen rewrites the file.

Here's a short script to do it:
powershell -Command "(gc angular.json) -replace '\"buildOptimizer\": true', '\"buildOptimizer\": false' | Out-File -encoding ASCII angular.json"

You can add angular.json to application ignore list:

1 Like

There seems to be a conflict between a certain d3 module (d3-format@1.4.2) and the Angular build optimizer. Adding a specific dependency to your package.json should resolve that:

"dependencies": {
   /* snip */
   "d3-format": "1.3.2"
}
1 Like