-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
duplicate app state in prerendered page #128
Comments
Hi @spencerodai, thanks for reporting this. I wasn't aware of the problem so far. I made a quick check and it looks like all the apps that I use with angular-prerender don't have this problem. Is your project available somewhere? Or if not could you create a small example which reproduces the problem? This might of course be totally wrong, but my first guess would be that you somehow prerender the same HTML document twice. Is that possible? |
thanks for your reply, I will investigate this further. I have another question, is there a way to pass a txt file with the defined routes in the command to prerender pages, as opposed to entering a space delimited list? |
Hi @spencerodai, sorry for the delay. You mean a file based replacement for the Any use on the duplicate app state problem you're experiencing? |
thanks for getting back to, no in my app, I am not able to pick up the routes automatically and this is actually desirable in our case. we will be prerending over 20000 pages and its tasking for out ci/cd process so we wanted to have a bit more control and only prerender sections of the app on some deployment event. we also wanted to be able to pass in a route that has edited by our CMS and prerender that page only for example. As for duplicate state, I think I know the problem and its from my app, not angular-prerender, but I haven't gotten around to fixing this yet. Thanks a bunch |
Hi @spencerodai, I definitely understand that rendering 20000 pages only because one of them changed is not desirable. :-) I guess that means you ideally also want to turn off the route parsing entirely, right? Right now that can't be done. |
I'm having the same issue with the duplicate app state problem. What's weird though is that when I run the prerender locally there is only one state script in each file. And when I run the prerender on my CI/CD (GithubActions), it creates a double state script - and the thing breaks because of that. I can't seem to figure it out. @spencerodai have you had some breakthrough? 🙏 |
@mfrancekovic I never got around to it as we decided to use angular universal prerenderer instead |
@mfrancekovic Is the project (including the GitHub Actions) publicly available somewhere? Or do you know of another way for me to reproduce the problem? |
hi @chrisguttandin, I am able to use this package to successfully, the only thing is that I get duplicate data states for example, I have <script id="serverApp-state"></script> injected twice where serverApp is the appId assigned to BrowserModule.withServerTransition({ appId: 'serverApp' }), and as a result, Browser transfer state mechanisms do not work. is this something that the package does intentionally and how can I get around it.
nb. when I delete the extra <script id="serverApp-state"></script>, transfer state works fine.
The text was updated successfully, but these errors were encountered: