I am new in Angular2, I am trying to go through functionalities with a demo project and used prerendering with Webpack in the code.
My code is here-
https://github.com/abrarjahin/Dot.NetCore_Angular2_App
I am getting this error-
An unhandled exception occurred while processing the request.
Exception: Call to Node module failed with error: Prerendering failed because of error: ReferenceError: window is not defined
at D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:6541
at D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:6473
at e.exports (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:6759)
at Object.<anonymous> (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:3513)
at t (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:217)
at Object.<anonymous> (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:3381)
at t (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:217)
at Object.e.exports (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:2992)
at t (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:217)
at Object.<anonymous> (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:1615)
at t (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:217)
at Object.<anonymous> (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:779)
at t (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:217)
at Zone.current.fork.name (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:310)
at Object.<anonymous> (D:\Dot.NetCore_Angular2_App\ProfileManagement\ClientApp\dist\main-server.js:1:315)
Current directory is: D:\Dot.NetCore_Angular2_App\ProfileManagement
I never used any window in my code.
Does anyone have any idea why I am getting this error?
Re-
I had checked this question - AngularJS ReferenceError: $window is not defined
But it is not helping.
Thanks in advance for helping.