angular-universal

Server Side Rendering Angular 6.1

天大地大妈咪最大 提交于 2019-12-13 05:47:42
问题 I am working with Angular 6.1.0 and following the official doc on SSR here. The problem I am facing is that when I run the command: npm run build:ssr && npm run serve:ssr the serve:ssr throws me a bunch of errors from the .spec.ts files of my node_modules . I've uploaded my project on GitHub here Since I have no idea what's breaking it. PS: The source code provided by the official docs also breaks with the same errors. Hence if must be something with my env Console Output: PS C:\Users\adity

Serve angular universal app with NodeJS/ExpressJS back-end

本秂侑毒 提交于 2019-12-13 04:44:21
问题 I have a Node/Express JS back-end deployed on an AWS instance, I am using a Linux image, and the web server I am using is NGINX. The MEAN application is running currently as I am building the Angular application and copy the dist folder to the Node/Express JS back-end and direct the back-end to serve the index.html, this works fine, it looks something like like . Node/Express JS let pathToClientApp = '/dist'; ... app.use(express.static(path.join(__dirname, pathToClientApp))); ... app.get('/*'

Angular Universal - Exclude Route

拈花ヽ惹草 提交于 2019-12-13 03:56:20
问题 Is it possible to not use angular universal for certain route? I want to use angular universal for my static pages. And when i login to my application i dont want to use it. I want to exclude route with /app/* How can i do that please? Thank you very much Here my server.ts // These are important and needed before anything else import { enableProdMode } from '@angular/core'; // Express Engine import { ngExpressEngine } from '@nguniversal/express-engine'; // Import module map for lazy loading

Meta tag is not updating in view source - angular

陌路散爱 提交于 2019-12-13 02:19:52
问题 I am trying to update meta tag in angular 6 and angular univarsal but it changes only in inspect element not in view page source it remains the same which is on home page. Homepage.ts . . . import { SeoserviceService } from "./../../services/seoservice.service"; constructor(private metaService: Meta, public router: Router, public _seoService: SeoserviceService) { } ngOnInit() { this._seoService.updateTitle('Home'); //Updating Description tag dynamically with title this._seoService

Angular Universal + External API

不想你离开。 提交于 2019-12-12 19:21:31
问题 I know that Angular Universal is still in development. So I have thought about using Angular Universal for a web app that regularly pulls data from an external API server (about every 10 seconds via the Http service). This data is then displayed on the web app. I have come across several problems that I haven't found an easy solution for yet: Angular Universal obviously needs data from the API server to prerender the page. I don't want to query the API server from nodeJS every time the web

Firebase Functions Log Error: function execution attempt timed out. Function invocation was interrupted

ぃ、小莉子 提交于 2019-12-12 10:20:48
问题 Issue: Error: function execution attempt timed out. Function invocation was interrupted. Exact Log Error: Error: function execution attempt timed out. Function invocation was interrupted. Tech: Angular 7, Angular Universal (SSR), Firebase, Firebase Functions. My functions/index.js file const functions = require('firebase-functions'); const { app } = require('./dist/server'); exports.ssr = functions.https.onRequest(app); Screen shot of the Firebase Functions Log Error: My functions package

Due to Zone.js in Angular Universal server rendering stops working. How to fix?

依然范特西╮ 提交于 2019-12-12 02:17:07
问题 When in my requests for data I return simple JSON without connection to database the server rendering in Angular Universal works fine. However I have found that requests to MySQL database is not going if I don't have a proper version of Zone.js. I had the following error: TypeError: Cannot read property 'on' of undefined at Protocol._enqueue (/Applications/MAMP/htdocs/Angular2/myproject/node_modules/mysql/lib/protocol/Protocol.js:152:5) ... Also I payed attention that I had a warning:

Deploy Angular 8 Universal (SSR) application on Firebase

喜欢而已 提交于 2019-12-11 16:12:49
问题 I recently upgraded my Angular 8 application to be an Universal application (SSR). I had it deployed to Firebase before it was a SSR application, but then I figured out that deploying a SSR application on Firebase doesn't work by using regular Firebase Hosting. I did some research and discovered that I have to use Firebase Cloud Functions. I created a SSR application using: ng add @nguniversal/express-engine --clientProject PROJECT_NAME PROJECT_NAME can be found in angular.json file below

Unexpected token import running node server.js

眉间皱痕 提交于 2019-12-11 08:07:24
问题 I'm trying to do the Angular Universal quickstart and am getting this error when I run "node server.js". Benjamins-MBP:vepo Ben$ node server.js /Users/Ben/Development/vepo/server.js:3 import 'angular2-universal/polyfills'; ^^^^^^ SyntaxError: Unexpected token import at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module.

Angular Universal - OG meta tags not working with child routes

ε祈祈猫儿з 提交于 2019-12-11 07:35:08
问题 My website hosted on http://abc.xyz.com OG meta tag works for the main page. If I am adding it to the child routes it doesn't work. for example - http://abc.xyz.com/pqr/slug-url. index.html <meta property="og:type" content="article"> <meta property="og:site_name" content="XYZ" > <meta property="og:title" content="XYZ" > <meta property="og:description" content="XYZ" > <meta property="og:image" content="xyz imagepath" > <meta property="og:url" content="xyz url" > component.ts this.meta