Skip to content

Conversation

@codediodeio
Copy link
Contributor

Checklist

Description

Step by step guide for Angular v6 Universal SSR

@davideast davideast self-requested a review May 24, 2018 19:55
Copy link
Contributor

@hiepxanh hiepxanh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm install --save-dev express webpack-cli ts-loader ws xmlhttprequest should adding webpack

Copy link
Contributor

@somombo somombo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it will be more relevant if this guide shows how to leverage firebase cloud functions

@codediodeio
Copy link
Contributor Author

@somombo I worked on SSR on Cloud Functions this weekend, but was not able to get it fully working in production. It's possible to deploy a function that works locally, but Universal will fail with the following error when it goes live. Not sure how to fix it yet...

Unhandled Promise rejection: el.querySelector is not a function ; Zone: <root> ;

```js
"scripts": {
// ... omitted
"build:ssr": "ng build --prod && ng run YOUR_PROJECT_NAME:server && npm run webpack:ssr",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it worth mentioning that ng run YOUR_PROJECT_NAME:server will actually use the dev configuration, i.e. environment.ts and not environment.prod.ts, while ng build --prod is actually building the client for production?

@jamesdaniels jamesdaniels merged commit a508ba8 into angular:master Aug 15, 2018
sulco pushed a commit to sulco/angularfire2 that referenced this pull request Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants