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

angular-calendar - "window is not defined". Angular 9 SSR #1211

Closed
rysal32 opened this issue Apr 3, 2020 · 5 comments
Closed

angular-calendar - "window is not defined". Angular 9 SSR #1211

rysal32 opened this issue Apr 3, 2020 · 5 comments

Comments

@rysal32
Copy link

rysal32 commented Apr 3, 2020

Describe the bug

I installed your plugin to my project which is in Angular 9 and I have an issue because when I wrote "npm run serve:ssr", it always came up with this error, "window is not defined". In server.ts, I already added those two lines of codes:

global['window'] = {};
global['KeyboardEvent'] = null;

However, it didn't solve everything. I have checked everywhere to find the solution.

Can you please help me to resolve this issue?

Thank you.

Versions

  • @angular/core: "~9.1.0"
  • angular-calendar: ""^0.28.5"
@matts-bot
Copy link

matts-bot bot commented Apr 3, 2020

Thanks so much for opening an issue! If you'd like me to give priority to answering your issue or would just like to support this project, then please consider sponsoring me

@nulee
Copy link

nulee commented Apr 9, 2020

Seems like this issue is not specific to Angular 9. It also occurs while using @angular/core: "~8.2.4".
npm run serve:ssr fails with the following error: TypeError: window.addEventListener is not a function

@mattlewis92
Copy link
Owner

Thanks for opening an issue, I've managed to find a way to make SSR work out the box without any hacks, please can you update to 0.28.7 and let me know if that works for you. Thanks! 😄

@rysal32
Copy link
Author

rysal32 commented Apr 13, 2020

Thanks for opening an issue, I've managed to find a way to make SSR work out the box without any hacks, please can you update to 0.28.7 and let me know if that works for you. Thanks! 😄

Thank you very very much @mattlewis92. You saved my day!! :) 👍 👍 👍

@mattlewis92
Copy link
Owner

Awesome, I'm glad to hear that it's fixed for you 😄

AlexGuz23 pushed a commit to AlexGuz23/angular-draggable-droppable that referenced this issue Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants