Topic: MDB in AngularCLI Universal

Teknomedia pro asked 6 years ago


Hi. I'm using the new .Net Core prerender Angular project (https://github.com/aspnet/JavaScriptServices/issues/1288#issuecomment-346003334) But there's some problem when it must prerender on server. Have you test it? I got this errors:
Prerendering failed because of error: ReferenceError: KeyboardEvent is not defined
In ng-mdb-pro/free/carousel/carousel.component.ts,
ng-mdb-pro/pro/date-picker/directives/datepickerAutofill.directive.ts

Prerendering failed because of error: ReferenceError: Event is not defined
In ng-mdb-pro/pro/file-input/directives/mdb-file-drop.directive.ts

Prerendering failed because of error: ReferenceError: window is not defined
In node_moduleshammerjshammer.js:2643:4
But now i found a solution... :) Use Global-JSDom (https://www.npmjs.com/package/global-jsdom) Then i added import 'jsdom-global/register'; on top in app.server.module.ts But I still got an error (not a breaking one):
ERROR TypeError: _this.navbar.nativeElement.append is not a function
In ng-mdb-profreenavbarsnavbar.component.ts#61
Is it possible to add undefined check on nativeElement? Thanks! / Henrik

Damian Gemza staff answered 6 years ago


Hi Teknomedia, I'm sorry, but we didn't tested our MDB with .NET Core predenderer, so we can't provide you any suggestions that you could use to solve your's problem. Best Regards, Damian

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags