-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
importing the main module causes errors while using Angular Universal #3222
Comments
After a bit of searching, I just added the following codes to server.js:
And now at least it runs fine. But still wondering why this happens. In addition, some of the components like |
@wendzhue I see in previous issues. But for me, it even doesn't allow me to run my server. Does it occur to you? Or maybe I'm doing something wrong. Thanks. |
@vahidvdn Haven't run into that problem before personally. What do you mean by |
I use ng-toolkit and it uses Angular Universal under the hood. You mean this doesn't happen in Angular Universal? Maybe relates to ng-toolkit library? How can I make a reproduction with stackblitz? There should be nodejs server. |
@vahidvdn You can create a new repo and share the link with us, but I guess the reason is that |
Ok, I'll do it. It might take a while.
That's true. It's like localStorage. But I'm wondering why this happens only to me.
Where do you mean I should test? Withing my Angular project. |
Hey @wendzhue Here is the GitHub repo, demonstrating the error. Please see the readme. |
@wendzhue Any idea why this happens to me? |
close NG-ZORRO#3222, close NG-ZORRO#43, close NG-ZORRO#1923 ref NG-ZORRO#2025,NG-ZORRO#2474
close NG-ZORRO#3222, close NG-ZORRO#43 ref NG-ZORRO#2025,NG-ZORRO#2474 style: fix lint docs: add the docs docs: fix ssr docs docs: update README chore: rebase
now NGzorro supposed to have SSR but i get the same error, simple angular cli generated app, ng add ngzorro, then ng add @nguniversal/express-engine, run npm run build:ssr and npm run server:ssr error ReferenceError: Event is not defined` |
@mapsgeek our doc site is built with static render with SSR, if you meet any problem, plz submit a new issue with repro link. |
sorry i didn't read the edits to the server.ts file in the docs, no problem now it works just fine :) |
@mapsgeek Where do you exactly mean? |
@vahidvdn https://ng.ant.design/docs/universal/en here |
* feat: support server-side rendering close NG-ZORRO#3222, close NG-ZORRO#43 ref NG-ZORRO#2025,NG-ZORRO#2474 style: fix lint docs: add the docs docs: fix ssr docs docs: update README chore: rebase * style: fix lint * docs: fix README
* feat: support server-side rendering close NG-ZORRO#3222, close NG-ZORRO#43 ref NG-ZORRO#2025,NG-ZORRO#2474 style: fix lint docs: add the docs docs: fix ssr docs docs: update README chore: rebase * style: fix lint * docs: fix README
* feat: support server-side rendering close NG-ZORRO#3222, close NG-ZORRO#43 ref NG-ZORRO#2025,NG-ZORRO#2474 style: fix lint docs: add the docs docs: fix ssr docs docs: update README chore: rebase * style: fix lint * docs: fix README
Reproduction link
https://stackblitz.com/edit/ng-zorro-antd-start-sm4bvm?file=src/app/app.component.ts
Steps to reproduce
Just simply install the module with
ng add
and import it in a module (lazy loaded) and run it by server. Everything is working fine without server side rendering.What is expected?
It's expected at least to run without error and if it's not compatible with Angular Universal, we can handle it with
*ngIf="isBrowser"
.What is actually happening?
I'm getting these errors:
Sorry about the demo link. This is not reproducible due to the error in server side rendering.
The text was updated successfully, but these errors were encountered: