DVLP / signalr-no-jquery

120 stars 78 forks source link

Server-side Pre-rendering (ssr, angular universal) fails because of reference to window #25

Closed JohnGalt1717 closed 7 months ago

JohnGalt1717 commented 7 years ago

signalR.js assumes "window" exists. Could you put in a fix that at the top of that file did if (typeof window !== 'undefined') {

} Then this will work for React and Angular amongst others with SSR enabled.
fzh5201413 commented 2 years ago

// vue nuxt.js
async beforeMount() { // import in Browser const { hubConnection } = await import('signalr-no-jquery') }