Search code examples
javascriptangularangularfire2angular-universalserver-side-rendering

Angular Universal --bundledependencies "all" won't work with firebase, "none" won't work with my charting module?


I've been using a basic angular 8.2.x project as boilerplate, made it SSR, all is good but I can't bundle dependencies due to @angular/fire, my app runs its auth + firestore + functions off of firebase through that package so I definitely need it.

My app is a reporting tool so I definitely need the charts as well. The issue is, when I Don't bundle dependencies and I try to run it, I get the following error:

SyntaxError: Unexpected token {

at:

node_modules\ngx-charts-extra\release\line-chart\line-chart.component.js:23

On the import statement of my charts module, so this is inside the actual node_module. This is the link to the package I'm using. -- In this case It is also one of the modules that I've forked and built myself to customize.

Is there a way I can get @angular/fire to work with SSR or a specific way I need to build my charts package in order to not get that syntax error on the import statement?


Solution

  • Ended up using webpack to bundle as an SSR and excluding the firebase module, which I've later included as a lambda layer.