Skip to content
Advertisement

Angular SSR NgApexcharts SVG is not defined

Originally I was having issues with this package using Angular SSR as I was getting this error on import Window is not defined

However, you can mock this in server.ts via the following:

JavaScript

I’m now getting an error as stated in the title, SVG is not defined. IS there any way to mock this?

I believe it uses https://github.com/svgdotjs/ under the hood

Thanks

Advertisement

Answer

Using ng-apexcharts, I still get the ReferenceError: SVG is not defined error. So this is what I tried and seems to be working.

  1. I’m NOT importing NgApexchartsModule

  2. template.html

JavaScript
  1. component.ts
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement