score:1
Accepted answer
the reason why this is happening is because you are running ssr with nodejs and there is no window object, so you need a nodejs replacement.
i suggest installing domino
npm i --save-dev domino
then in your server.ts
const domino = require('domino');
const template = fs
.readfilesync(path.join('dist/browser', 'index.html')) // or whereever your rendered index.html is
.tostring();
const window = domino.createwindow(template);
(global as any).window = window;
(global as any).document = window.document;
Source: stackoverflow.com
Related Query
- How do I run Chart.js with Angular 10 SSR / universal?
- Angular chart how to show the legend data value by default along with legend name
- Angular chart js how to use formatter with Doughnut chart
- How to run Chart.js samples using source code
- How we embed google analytics chart from google analytic with angular 4?
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- How to prevent first/last bars from being cut off in a chart with time scale
- How to fix chart Legends width-height with overflow scroll in ChartJS
- How to display Line Chart dataset point labels with Chart.js?
- chart js how to fill legend box with colour
- How do I draw a vertical line on a horizontal bar chart with ChartJS?
- chartjs: How to plot multi-line chart with irregular intervals
- Problem for display a chart with Chart.js and Angular
- How to display inline values in a stacked bar chart with Chart.js?
- How to display data labels outside in pie chart with lines in ionic
- Series Details Not Showing in Angular Chart with Charts.js
- Ng2-charts / chart.js - how to refresh/update chart - angular 4
- How can I trigger the hover mode from outside the chart with charts.js 2?
- How to update data Chart in async way in Angular Chart.js?
- How to set single color on each bar in angular chart js
- ChartJS - how to display line chart with single element as a line? (not as a dot)
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How to add images to chart labels with vue-chartjs?
- How to show percentage (%) using chartjs-plugin-labels ( Pie chart ) in angular 2/8
- How to create chartjs chart with data from database C#
- How to add title inside doughnut chart in Angular Chart?
- How to use an Addon with ChartJS on Angular 4
- How to draw a chart with Chart.JS?
- ERROR TypeError: "this.canvas is undefined" | Problem with creating a chart with angular and chart.js
- How to add area with break on line chart with fill color
More Query from same tag
- Chart.js how can we have a column not start at 0
- Angular ng2-charts chartsjs-plugin-labels options not working
- ChartJs how to get from mulitiple dateset which dataset bar is clicked
- Chart.js I want to fix my xAxis to my yAxis position 0
- How to Render Chart Datasets in Vue?
- Chartjs defaults deprecation warning
- ChartJS rotate 90' but keep text straight
- Meteor / React.js / Chart.js issue
- Chartjs destroy method not affecting the chart
- ChartJS bar not showing up for simple data points
- Chart JS chart not rendering in ArcGIS popup when using navigation arrows
- Chart.js - Creating multiple charts on one page
- How to show xaxis lable o only data point and hide all others?
- Chart.js load new data from saved JSON object
- Bar chart from Vue-chartjs doesn't render
- How do I stop chart js from auto rescaling the y axis upon calling chart.update()?
- Angular4 ng2-charts TypeError: Cannot read property 'length' of undefined
- How to stop axis label from being cut off in chart JS?
- Doughnut spacing
- angular-chart.js - chart height not working on iOS but works fine on Android and Web
- Chart.JS value on top disappear when tooltip show up
- Convert PHP array to chart.js compatible data
- Change data onclick with ChartJS
- Vertical spacing in horizontal ChartJS Bar Graph
- Configuring ChartJS from VB.NET
- Chart.js time scale showing one of the dates wrong
- Performance issue, what causes it?
- How to convert a bar chart into a triangle shaped chart using Chart JS?
- angular-chart not showing Pie Chart
- Chart.js in Vue defining multiple datasets