angular/universal

render method in server.ts can find index but browser never rendered

vincentDarcq opened this issue ยท 2 comments

๐Ÿž Bug report

  • builders
  • common
  • express-engine

Description

I've installed "@nguniversal/express-engine": "^15.2.0" with npm install.
If I launch with dev:ssr or serve:ssr, I can see the route in server.ts triggered but my browser is infinitely loading.

๐Ÿ”ฌ Minimal Reproduction

Here is my project : https://github.com/vincentDarcq/Cosycorse
You can reproduce the problem on the feature/SSR branch. You probably will need to make npm i --force because of a deprecated lib that I will remove after this pb will be solved and you'll see some API requests (i18n) but even if there is no server, I should see a render and there's nothing.

๐Ÿ”ฅ Exception or Error


I can't see any errors... it drive me crazy...

๐ŸŒ Your Environment


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / โ–ณ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 14.2.11
Node: 18.15.0 (Unsupported)
Package Manager: npm 9.5.0 
OS: darwin arm64

Angular: 14.3.0
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.11
@angular-devkit/build-angular   14.2.11
@angular-devkit/core            14.2.11
@angular-devkit/schematics      14.2.11
@angular/cdk                    14.2.7
@angular/cli                    14.2.11
@angular/flex-layout            14.0.0-beta.41
@angular/material               14.2.7
@nguniversal/builders           14.2.3
@nguniversal/express-engine     15.2.0
@schematics/angular             14.2.11
rxjs                            6.6.7
typescript                      4.6.4
    

Well, I finally found my problem... these lines in my app.component :
if(!this.cookieService.check(this.title)){
this.cookieAsked = false;
}else {
this.cookiesManagementService.cookieConsented = this.cookieService.get(this.title) === 'true' ? true : false;
}

So the cookieService lib is to put conditionally with the platform browser.
Commenting these lines and I got my page with all source code as expecting inspecting the browser.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.