angular-universal

Angular Universal TTFB is very slow

試著忘記壹切 提交于 2020-06-28 04:45:24
问题 When I run my application with angular universal, I am seeing huge difference in TTFB. ssr is taking more time than normal angular command. How to improve TTFB with angular universal server side rendering? npm run serve:ssr Performance tab: ng serve Looked into many sites but didn't found any relevant solution on internet till yet. 回答1: It seems that you have a setTimeout or an http call that takes too much time to finish and angular universal does not serve the webpage until all the calls

Angular SSR localhost: 4000 does not open

℡╲_俬逩灬. 提交于 2020-06-17 04:27:11
问题 I have an Angular project and I want to make it seo compatible. I did this with Angular Universal, but localhost: 4000 doesn't open. When I enter localhost: 4000 / index.html, it opens and redirects to localhost: 4000. However, the page source code appears as . So it's not happening. I wondered, "Did I do something wrong?" I asked. And another new Angular project created the same operations I've created on it worked without a problem. However, it does not work in my current project. My files

Angular SSR localhost: 4000 does not open

匆匆过客 提交于 2020-06-17 04:27:05
问题 I have an Angular project and I want to make it seo compatible. I did this with Angular Universal, but localhost: 4000 doesn't open. When I enter localhost: 4000 / index.html, it opens and redirects to localhost: 4000. However, the page source code appears as . So it's not happening. I wondered, "Did I do something wrong?" I asked. And another new Angular project created the same operations I've created on it worked without a problem. However, it does not work in my current project. My files

Angular 9 universal Error: Component 'HeaderComponent' is not resolved:

江枫思渺然 提交于 2020-05-24 03:32:07
问题 After update to angular 9 and universal 9, a got error when i run npm run build:ssr && npm run serve:ssr Error: Component 'HeaderComponent' is not resolved: - templateUrl: ./header.component.html - styleUrls: ["./header.component.scss"] Did you run and wait for 'resolveComponentResources()'? at Function.get (D:\projects\my-app\node_modules\@angular\core\bundles\core.umd.js:26828:31) at getComponentDef (D:\projects\my-app\node_modules\@angular\core\bundles\core.umd.js:2021:20) at

Angular 9 universal Error: Component 'HeaderComponent' is not resolved:

百般思念 提交于 2020-05-24 03:30:24
问题 After update to angular 9 and universal 9, a got error when i run npm run build:ssr && npm run serve:ssr Error: Component 'HeaderComponent' is not resolved: - templateUrl: ./header.component.html - styleUrls: ["./header.component.scss"] Did you run and wait for 'resolveComponentResources()'? at Function.get (D:\projects\my-app\node_modules\@angular\core\bundles\core.umd.js:26828:31) at getComponentDef (D:\projects\my-app\node_modules\@angular\core\bundles\core.umd.js:2021:20) at

NestJS Angular Universal not loading “index.html” automatically on root path

倖福魔咒の 提交于 2020-05-17 06:09:47
问题 I am running an NestJS Angular Universal app on my local server using Angular 9 and Ivy. I can get everything to work when I run: npm run serve:ssr However, nothing loads unless I type the route manually. I would think it would automatically load "index.html" without having to type it in. localhost:8080 ----- nothing localhost:8080/index.html ---- works Is there a way to modify the code to do a rewrite for the root path? I would think this would not be necessary: main.ts import { NestFactory

NestJS Angular Universal not loading “index.html” automatically on root path

谁都会走 提交于 2020-05-17 06:09:31
问题 I am running an NestJS Angular Universal app on my local server using Angular 9 and Ivy. I can get everything to work when I run: npm run serve:ssr However, nothing loads unless I type the route manually. I would think it would automatically load "index.html" without having to type it in. localhost:8080 ----- nothing localhost:8080/index.html ---- works Is there a way to modify the code to do a rewrite for the root path? I would think this would not be necessary: main.ts import { NestFactory

Angular 9.0 SSR is compiled, but I cannot publish it on the server

三世轮回 提交于 2020-05-09 10:52:51
问题 I updated my Angular 8 project to Angular 9. I ran the command “npm run build: ssr && npm run serve: ssr”. It worked flawlessly and “browser” and “server” folders were created in the “dist” folder. I uploaded these files to my server (Plesk panel). I set it to read server / main.js file with node.js. It failed because it could not find “browser / index.html” in “dist” folder. I created a folder called “dist” and moved the “browser” folder into it. Then it timed out, my project did not work. I

I have to log in to view the page. Angular 9 Universal + Firebase

↘锁芯ラ 提交于 2020-04-30 07:03:46
问题 I'm using Angular 9 Universal + Firebase. When I use command npm run build:ssr I've got one extra file in my dist folder. The file is dist/server/vendors~firebase-auth.js . I don't know what does this file do and why I have it but every time when I open my application from incognito window I have to log in via Google or I can't see the page. Versions: "@angular/cdk": "^9.2.1" "firebase": "^7.14.1" "@angular/fire": "^6.0.0" I use this answer to deploy my app. When I inter gmail and password I

Is there something wrong with making an http request in the ngOnInit of a component when using Angular Universal?

我的未来我决定 提交于 2020-04-30 06:28:45
问题 I have been running my Angular app via ng serve for development and was not experiencing any errors. When using SSR, however, I get an error in my server log whenever I load a component that makes an http request as part of it's ngOnInit method. Is there something wrong with my strategy? I have not found any useful information from googling my error. Should I be waiting before the page is fully loaded to make my request, or using some other method? If so, how would I do this? I am using the