-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Angular Universal dev:ssr doesn't work after upgrade to v12.3.5 #5848
Comments
It works with 12.2.0 https://github.com/maxisam/nx-ng-ssr-12/tree/nx-12.0.0 I think it somehow run node server twice or something. The good thing is it is easy to workaround this issue. Just change something, it will trigger rebuild again and serve correctly. |
Thanks for reporting this! Could you please retry with the latest version? There was an issue with the Angular CLI and Windows causing the build to trigger multiple times. That was resolved in version 12.0.2 of the Angular CLI. Make sure you have your Angular dependencies on 12.0.2 or later to get the fix. |
nope. It doesn't work in 12.0.4. I have checked that thread. The symptoms is just like what they said. The worse part is the workaround doesn't work with 12.0.5. I have to revert back to 12.0.4 |
Well, guess what it is fixed by Angular 12.1.0 It still throws an error like this
However, everything works as far as I know |
@maxisam I've been unable to reproduce this issue. I set up a VM with Windows to test it and I did see the immediate rebuild after the initial build, but I didn't get the error you're showing as you can see in the following screenshot: I tested it with this environment: Node : 14.17.1 I used the repo you shared https://github.com/maxisam/nx-ng-ssr-12 on the branch nx-12.3.5. One thing I noticed (though it didn't have an impact on this issue) is that the |
I don't doubt you're facing the issue, but I'm unable to reproduce it. As I shared in my previous comment, I used that branch with a fresh yarn install as well as updating the The only differences from what you're saying are that my Yarn version is a 1.22.10 vs 1.22.5 and that I'm running a VM with Windows 10, but that should be the same as using an actual Windows laptop. Unfortunately without a way to reproduce it, I can't do much more. I guess one thing we can try to discard is if this happens in an Angular CLI workspace or if it's only on an Nx workspace. To do that, please use the failing branch in the provided repo and replace the following in the
with:
Then, delete your Now you can run using the Angular CLI instead of Nx. Please run |
I update the repo and use npm 7.19.0 https://github.com/maxisam/nx-ng-ssr-12/tree/nx-12.3.5. The error is still there. |
The npm version shouldn't be a factor here unless it resolves different packages versions which I don't think is the case. Can you stay with yarn and do the steps I outlined in the previous comment to see if the error happens with the Angular CLI? |
I was afraid different version of yarn might resolve different package, that is why I switch to npm. (I don't want to update yarn right now.) It does show the error with your step. The worse part., it doesn't work with 12.1.0. in that example repo. (But it works on my real one.) I think I probably will create another repo to test this. |
It's fine, I don't think the package manager matters here. I wanted to discard if this was an Nx specific issue or if it's something that happens with the Angular CLI. If I understood correctly, you are saying the error still happens when running with just the Angular CLI. If that's the case and you can put together a minimal repro with the Angular CLI ( |
@leosvelperez I think you are right https://github.com/maxisam/NG12-SSR-TEST When I run this repo which is brand new ng new + ssr, it shows alright first but as soon as you change something, it throws error. I think the bug is from Angular. |
I see, at least we were able to determine that, I'm sorry I couldn't help more, it's difficult without being able to reproduce it. You can create an issue on the Angular CLI repo posting that reproduction and you can update this thread with a link to that issue so anyone encountering this one can follow it for updates. I'm closing this one since it doesn't seem to be an Nx issue. If you still think it is, please feel free to reopen it. |
@maxisam I am facing the same issue. Do you have any workaround? Or were you able to find a couple of versions working well together? (12 <= ng < 13) If you created an issue in a Angular repo, can you paste a link to it? |
@adeprez The workaround is using Linux environment to run it. I kinda lost track on this one. Sorry about that. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
showing error like
Steps to Reproduce
demo repo : https://github.com/maxisam/nx-ng-ssr-12
If you revert it back to 11. (7f8d5ab17448a015ecfd4249f9f52a744d3fd871) it works.
Environment
node 14.16.1
windows: 10
The text was updated successfully, but these errors were encountered: