Title: docs: universal guide is missing steps · Issue #16038 · angular/angular · GitHub
Open Graph Title: docs: universal guide is missing steps · Issue #16038 · angular/angular
X Title: docs: universal guide is missing steps · Issue #16038 · angular/angular
Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/an...
Open Graph Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request...
X Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not su...
Opengraph URL: https://github.com/angular/angular/issues/16038
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"docs: universal guide is missing steps","articleBody":"\u003c!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\r\n-->\r\n\r\n**I'm submitting a ...** (check one with \"x\")\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\n\u003c!-- Describe how the bug manifests. -->\r\nI cannot serve Angular Universal build when I followed only Angular Universal Docs.\r\n\r\n**Expected behavior**\r\n\u003c!-- Describe what the behavior would be without the bug. -->\r\nI can serve Universal build successfully.\r\n\r\nIt is great Document. Thank you!\r\nBut, It has missing steps for serving AOT or Universal build.\r\n\r\n# 1. There is no explanation about index-aot.html\r\nOf course, It is not hard. I succeed with below code.\r\n```html\r\n\u003c!DOCTYPE html>\r\n\u003chtml>\r\n \u003chead>\r\n \u003cbase href=\"/\">\r\n \u003ctitle>Angular Tour of Heroes\u003c/title>\r\n \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n\r\n \u003clink rel=\"stylesheet\" href=\"styles.css\">\r\n\r\n \u003c!-- Polyfills -->\r\n \u003cscript src=\"node_modules/core-js/client/shim.min.js\">\u003c/script>\r\n\r\n \u003cscript src=\"node_modules/zone.js/dist/zone.js\">\u003c/script>\r\n \u003c/head>\r\n\r\n \u003cbody>\r\n \u003cmy-app>Loading...\u003c/my-app>\r\n \u003c/body>\r\n \u003cscript src=\"dist/build.js\">\u003c/script>\r\n\u003c/html>\r\n```\r\nBut, the beginner may be confused about missing this code.\r\n\r\n# 2. webpack's output.path requires absolute path\r\nI don't know when they requires absolute path at output.path, But webpack said \"please give me absolute path at output.path\" with version webpack 2.4.1.\r\n\r\nTherefore, instead of\r\n```javascript\r\noutput: {\r\n path: 'src/dist',\r\n filename: 'server.js'\r\n},\r\n```\r\n, use it.\r\n```javascript\r\noutput: {\r\n path: path.join(__dirname, 'src/dist'),\r\n filename: 'server.js'\r\n},\r\n```\r\nor any more simple code.\r\n\r\n# 3. webpack.config.uni.js has 3 differences.\r\nDocs says..\r\n```text\r\nThe Webpack configuration file for Universal is almost the same as for AOT. There are two differences:\r\n\r\nThe entry points\r\nThe output file name\r\n```\r\nBut, Exactly, There are one more differences at plugins!\r\n\r\nIt needs to change to tsconfig-uni.json.\r\n```javascript\r\nplugins: [\r\n new ngtools.AotPlugin({\r\n tsConfigPath: './tsconfig-uni.json'\r\n }),\r\n```\r\n\r\n# 4. We need @types/express \r\n\r\nThank you for super-easy Angular Universal Document!\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n\u003c!--\r\nIf the current behavior is a bug or you can illustrate your feature request better with an example, \r\nplease provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\r\nhttps://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).\r\n-->\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\n\u003c!-- Describe the motivation or the concrete use case -->\r\nJust read and write code with Angular Universal Docs for learning\r\n\r\n**Please tell us about your environment:**\r\n\u003c!-- Operating system, IDE, package manager, HTTP server, ... -->\r\nNot related.\r\n\r\n* **Angular version:** 2.0.X\r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n4.0.2\r\n\r\n* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]\r\n\u003c!-- All browsers where this could be reproduced -->\r\nNot related.\r\n \r\n* **Language:** [all | TypeScript X.X | ES6/7 | ES5]\r\nTypeScript 2.2.0\r\n\r\n* **Node (for AoT issues):** `node --version` = \r\n6.9.4","author":{"url":"https://github.com/Develofrog","@type":"Person","name":"Develofrog"},"datePublished":"2017-04-16T18:12:24Z","url":"https://github.com/angular/angular/issues/16038"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a83338ab-b606-1959-7bd1-c1d25ee4583e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACD2:1EC9BC:15996A7:1B892BF:6B0133F3 |
| html-safe-nonce | ea87f239f199932a3f69e8e16b764d30245aa039f883b97e5c8c26b1a0be0f5c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0QyOjFFQzlCQzoxNTk5NkE3OjFCODkyQkY6NkIwMTMzRjMiLCJ2aXNpdG9yX2lkIjoiNDgwNTQxMDU1MDE3MzQ3OTkyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d4a702450d5792f08508f429d8eea18f831cefd5bf6e7320fd2113163cfa0bda |
| hovercard-subject-tag | issue:222024251 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/16038/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d11dd7883a205c0e5f2bfd15a518bb6e73976cff6d9ee0881d3770f6719fa451/angular/angular/issues/16038 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d11dd7883a205c0e5f2bfd15a518bb6e73976cff6d9ee0881d3770f6719fa451/angular/angular/issues/16038 |
| og:image:alt | I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Develofrog |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width