ReferenceError: window is not defined (Angular 6 with dotnet core)
See original GitHub issueHello guys!
I’ve followed all the documentation guidelines, I’ve been looking for some solved issues, I’ve tried to correct this of many ways.
But I still can not use this lib in my application in Angular 6 with dotnet core.
When I install the lib (“jspdf”: “^1.4.1”) and try to use that, the application crashes with the error: “… window is not defined.”.
Error on debugger:
Error on browser:
My code:
...
import * as jsPDF from 'jspdf';
...
ngOnInit(): void {
let doc = new jsPDF({
orientation: 'landscape',
unit: 'in',
format: [4, 2]
});
doc.text('Hello world!', 1, 1);
doc.save('two-by-four.pdf');
}
...
Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
ReferenceError: window is not defined , angular6 universal
"window is not defined" came from 3rd party library which accessing window variable. You should wrapping your code ...
Read more >window is not defined (Angular 6 with dotnet core ... - GitHub
When I install the lib ("jspdf": "^1.4.1") and try to use that, the application crashes with the error: "... window is not defined."....
Read more >Angular Universal: ReferenceError: window is not defined
This error can be caused by a reference to the Window object if you are rendering your application from a server like Node.js....
Read more >'Kendo is not defined' issue in UI for ASP.NET MVC - Telerik
Hi, Am getting 'Kendo is not defined' error while using date picker MVC UI control. Uncaught ReferenceError: kendo is not defined.
Read more >Uncaught ReferenceError: Angular is not defined
In this article, we will see the “Uncaught ReferenceError: Angular is not defined”, along with knowing a possible way to resolve it.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Duplicate of #1891
Will be fixed in 1.4.2
11 issues to go… Unknown… when i fix every 2-3 days an issue in about 30 days it will be ready. But i have alot to o anyway… so more like 50 days or so…