Support Forums

Deployment fail


I’m working on an Angular Universal app that was previously deploying fine. It’s working as expected on local but failing to deploy to Netlify, and I’m completely stumped on how to fix this. I saw that there was an update required 'CI= ’ at the start of the build command? But that hasnt helped. I’ve tried deploying without pre-rendering with the same error result. Hmm, uummm… what else…

The only other thing I’m seeing here is ‘Error: Cannot read property ‘unsubscribe’ of undefined’ but I’m not sure what this is referring to, and it isnt showing locally.

The app is at https://focused-dubinsky-940e98.netlify.app/sign-in and the build log is at Netlify App

Any help on this would be HUGELY appreciated.


Your original or first error is: Netlify App

window is not defined. This usually happens when you’re referring to window object in non-browser code. At leas in Gatsby, it’s fixed by something like: https://blog.greenroots.info/gatsby-the-window-is-not-defined-error-what-and-how-to-fix-it-ckl0hfuxw08f3l1s1djh53nji

1 Like

Great, thanks @hrishikesh! I thought it was something to do with the server.ts, but I found the culprit. I’ve removed the following as a temp fix.

window.addEventListener('resize', (event: UIEvent) => {
     let w = event.target as Window;