We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Angular 4 universal: window is not defined

Hi,

with Angular 4 universal we get follow error:

window is not defined ->

Client\dist\main-server.js:28960:119)
at window.ej.window.Syncfusion

Is it possible to use your component under angular 4 universal?

Example project: https://github.com/MarkPieszak/aspnetcore-angular2-universal

Regards

j.nord

7 Replies

AS Abinaya Subbiah Syncfusion Team May 22, 2017 12:51 PM UTC

Hi Jürgen Nordholz, 

The support incident has been created under your account and we have discussed your query in that. Please log on to our support website to check for further updates.  


Regards,  
Abinaya S  



JO Joe replied to Abinaya Subbiah September 4, 2017 07:50 AM UTC

Hi Jürgen Nordholz, 

The support incident has been created under your account and we have discussed your query in that. Please log on to our support website to check for further updates.  


Regards,  
Abinaya S  


Hi,


I have followed below thread but the error still exists, any idea?

https://www.syncfusion.com/forums/130365/microsoft-aspnetcore-spatemplates


NodeInvocationException: Prerendering failed because of error: ReferenceError: window is not defined
at Object.<anonymous> (C:\Users\xxx\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\ClientApp\dist\main-server.js:125:119)
at window.ej.window.Syncfusion (C:\Users\xxx\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\ClientApp\dist\main-server.js:124:37)


Regards,

Joe



AS Abinaya Subbiah Syncfusion Team September 6, 2017 11:28 AM UTC

Hi Joe, 

Thanks for contacting Syncfusion support. 

We have analyzed the issue “window is not defined” , the issue caused due to window, document and DOM manipulations are implemented in jQuery which is required to render Essential Studio for JavaScript (EJS1) Angular components. The root cause of  the issue is accessing window, document and DOM not supported in Angular universal, since we are not able to integrate our Essential JavaScript 1 for Angular components into Universal application.  

For you kind information, we rolled out beta release of our Essential Studio for JavaScript 2 components which is fully, built on top of TypeScript, which doesn’t need of any external dependencies like jQuery. We consider the feature Angular Universal support in our EJS2 suite, which will be included in our upcoming releases. For now the following components are available for use. 
  
  • Chart
  • Grid
  • Button
  • Calendar
  • NumericTextBox
  • TextBoxes
  • ListView
  • Dialog
  • Toolbar
  • Tooltip
   
You can start using above controls using following getting started document 


Demo application is available in the following location 


Please let us know if you need further assist on this.  

Regards, 
Abinaya S 




JO Joe replied to Abinaya Subbiah September 7, 2017 10:21 AM UTC

Hi Joe, 

Thanks for contacting Syncfusion support. 

We have analyzed the issue “window is not defined” , the issue caused due to window, document and DOM manipulations are implemented in jQuery which is required to render Essential Studio for JavaScript (EJS1) Angular components. The root cause of  the issue is accessing window, document and DOM not supported in Angular universal, since we are not able to integrate our Essential JavaScript 1 for Angular components into Universal application.  

For you kind information, we rolled out beta release of our Essential Studio for JavaScript 2 components which is fully, built on top of TypeScript, which doesn’t need of any external dependencies like jQuery. We consider the feature Angular Universal support in our EJS2 suite, which will be included in our upcoming releases. For now the following components are available for use. 
  
  • Chart
  • Grid
  • Button
  • Calendar
  • NumericTextBox
  • TextBoxes
  • ListView
  • Dialog
  • Toolbar
  • Tooltip
   
You can start using above controls using following getting started document 


Demo application is available in the following location 


Please let us know if you need further assist on this.  

Regards, 
Abinaya S 



Hi,


Thanks for your prompt reply, but the grid component seems not work in my project using ej2-ng-grids. 

Any advice on what's wrong with my current settings would be appreciated.


https://github.com/JosephTsang/aspnetcore-angular2-universal-master


Best Regards,

Joe



SS Sridhar S Syncfusion Team September 11, 2017 06:35 AM UTC

Hi Joe,  

Currently Essential JS 2 don’t have support for Angular Universal. This support will be available in our Upcoming Essential Studio Volume 4 release.  

Please share the details if did you faced any issue while integrating Essential JS 2 Grid in to an angular application on client side? 

Thanks,  
Sridhar S 



CH chetan replied to Joe April 6, 2018 07:10 AM UTC

Hi Jürgen Nordholz, 

The support incident has been created under your account and we have discussed your query in that. Please log on to our support website to check for further updates.  


Regards,  
Abinaya S  


Hi,


I have followed below thread but the error still exists, any idea?

https://www.syncfusion.com/forums/130365/microsoft-aspnetcore-spatemplates


NodeInvocationException: Prerendering failed because of error: ReferenceError: window is not defined
at Object.<anonymous> (C:\Users\xxx\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\ClientApp\dist\main-server.js:125:119)
at window.ej.window.Syncfusion (C:\Users\xxx\Documents\Visual Studio 2017\Projects\aspnetcore-angular2-universal-master\ClientApp\dist\main-server.js:124:37)


Regards,

Joe


dsadsadsa


SM Saranya Murugasamy Syncfusion Team April 9, 2018 12:59 PM UTC

Hi Jurgen, 
Kindly let us know if you have any technical queries with Syncfusion Products, We are here to assist you as always. 
Regards, 
Saranya Murugasamy 
 


Loader.
Live Chat Icon For mobile
Up arrow icon