-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
build(docs-infra): introduce prerendering for angular.io app's index.html
and 404.html
#10
Comments
index.html
and 404.html
index.html
and 404.html
Shall i try with your help always? :) |
Hello, I am able to run in local the aio project but facing issues when trying to run pre-render. More specifically based on 'Blogpost on prerendering with Angular Universal' I followed the below steps:
Seems that the issue might be with the current version of @Angular-devkit By testing the same guide in another test project it run without any issue so I tried to install same version of @Angular-devkit.
No luck. So there are two questions:
|
Thx for looking into this, @gmavridakis!
|
Hi @gkalpak , It worked hopefully and now I am getting a new error when I am running with "routes": ["/"]:
Keep in note that compilation is completed without any issues but in final stage of prerendering it fails (I can confirm also due to the fact that no original file is generated under dist/browser) With the help of @bampakoa we tried to investigate further where exactly the issue is and reached to this related issue: Any other suggestions? :D |
Aha! I think this is this known issue with However, angular.io is currently v10.1.3, so the fix is not available there. So, you need to wait for something like angular/angular#39441, that updates angular.io to newer versions. In the meantime, you can try updating just the - "@angular/elements": "10.1.3",
+ "@angular/elements": "10.2.1", Let me know if that helps. |
@gmavridakis we will be having another workshop next Thursday 😃 You are more than welcome to attend if you would like to continue working on the issue. We are here to help 👌 Let me know if you want so that I can send you a Zoom link for the event. |
Hi @bampakoa , As I am still working on the issue I will not attend this workshop. Thanks |
Hi @gkalpak, So I upgraded to the suggested version but still no luck - getting the same error so not sure if this is related to elements after all.
If there is any other suggestion is more than welcome otherwise I will try to find related issues :) Thanks |
I see that you used |
Nice! I noticed that your commit is based on an older commit from master. Can you rebase your branch on top of the latest master commit (which uses v11 for angular.io)? (Before doing that make sure you get rid of the If you are still getting the error, ping me here and I'll take a look. |
@gkalpak good news since there is progress :) I rebased based on master branch which has angular 11 version as suggested and applied again current installation.
Hopefully, in prerender command, there was no error related to promises as before so you were right it was related to version of Angular. Now the error I get is the below:
Based on it I understand that the error is in command: So the error I am getting when running this command is:
Now I am focused in server.ts file to figure out why it cannot identify index.html! Last but not least I committed again all my progress here. Thanks in regards for your time :D |
Thx for the update, @gmavridakis 👍 I took a quick look and this seems to be a bug/incompatibility with elements and universal. The error comes from the fact that the abstract This is essentially a variation of angular/angular#24551. Could you please open an issue on the angular/angular repo and provide a description of the problem (feel free to also include my description above) and minimal reproduction of the problem? 🙏 For the reproduction, you should create a branch that is on the same commit as the current (Feel free to ping me if you need any help with the process and I can also add additional context/details on the issue you will create, if needed.) |
For reference, here is the issue (reported by @juristr, who ran into the same problem): angular/angular#39950 |
Investigate enhancing the angular.io app's build process with prerendering (via
@angular/platform-server
/@nguniversal/express-engine
) for:/index.html
/404.html
Context regarding
404.html
Currently, a 404 page is generated for the angular.io app using a script, aio/scripts/build-404-page.js, which is invoked as part of the build process using the build-404-page npm script. The page is generated based on a hard-coded template, aio/src/404-body.html, which needs to be manually kept in sync with the actual page's style/layout.
NOTE 1: This is only about prerendering those two pages; it is not about introducing server-side rendering.
NOTE 2: This can be split up by a prerendered page.
Related resources:
The text was updated successfully, but these errors were encountered: