Angular2-jwt: SSR is failing window doesn't exist

Created on 30 May 2018  路  5Comments  路  Source: auth0/angular2-jwt

Hello,

I trying to enable server side rendering on an existing project but it fail because of

ReferenceError: window is not defined
at Object. (/.../node_modules/@auth0/angular-jwt/bundles/core.umd.js:1:704)
I this module SSR ready ? Or did I miss something ?

Most helpful comment

I'm getting the same problem trying to use angular-jwt in a nativescript 4.1 app (uses angular 6)

All 5 comments

I got a similar problem - looks like bad bundeling?

I'm getting the same problem trying to use angular-jwt in a nativescript 4.1 app (uses angular 6)

As a workaround, if you are using a bundler like Webpack or Parcel already for your final project, you can work around this issue for now by importing @auth0/angular-jwt/index.js directly, which skips the UMD bundle.

@beloitdavisja Did you overcame this problem in nativescript 4.1?

@boris01 no, but I have not tried ceph3us's workaround yet. For now still using 4.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ciesielskico picture ciesielskico  路  5Comments

sfabriece picture sfabriece  路  4Comments

dmitrybz picture dmitrybz  路  4Comments

wannabegeek picture wannabegeek  路  3Comments

UlyssesAlves picture UlyssesAlves  路  5Comments