Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window is not defind with Server Side Rendering #291

Closed
mdantonio opened this issue Dec 29, 2020 · 1 comment
Closed

Window is not defind with Server Side Rendering #291

mdantonio opened this issue Dec 29, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@mdantonio
Copy link

Describe the bug
When prerendering an angular app server side with UploadxModule imported in the ngModule I obtain a window is not defined error. I already tried to polyfill the window obj as suggested for example here: angular/universal#1523
But with no success with ngx-uploadx (I made all other dependencies of my project to work on ssr but failed with ngx-uploadx)

To Reproduce
I basically followed the setup explained here: https://github.com/angular-university/angular-universal-course/tree/master

then when executing the prerendering I obtain the error window is not defined that made the prerendering to fail

Expected behavior
ngx-uploadx should work when the page is prerendered server side or at least silently fail. I'm pretty new to angular ssr so I don't know exactly how ngx-uploadx should behave

Setup details:

  • Used ngx-uploadx 4.0.1
  • Used Angular version 11.0.5
@kukhariev kukhariev added the bug Something isn't working label Dec 29, 2020
kukhariev added a commit that referenced this issue Jan 13, 2021
kukhariev added a commit that referenced this issue Jan 16, 2021
* fix: safer use of the window object

#291

* test: use ts3.2 compatible node types
@mdantonio
Copy link
Author

Hello, just tested version 4.0.2 and I confirm that the problem is fixed, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants