- ABP Framework version: v7.1.0
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace: see decription below
- Steps to reproduce the issue:
- Create a empty ABP project of version 7.1.0 with angular frontend.
- run next command in command prompt:
ng add @nguniversal/express-engine
- run next command in command prompt:
npm run dev:ssr
Result: Failure on startup inside @abp/ng.oauth (code inside compiled vendor.js included below):
To investigate problem deeper I have replaced directly in vendor.js that line with:
const oAuthStorage = {getItem: function() {}, setItem: function(){}, removeItem: function(){}, clear: function(){}, keys: function(){}};
This line has passed however it failed further.
I found out that there is a chain of other troubles inside of ABP:
- Then LeptonX failed, cause it has a direct access to window object in it. Fortunately I had a sourceCode of it, so I found out that I can replace createWindowProvider in ThemeLeptonXModule with my own like so:
- Also I had to do a next manipulation in server.ts to make it work: (but it's typical for SSR setup in angular),
- Finally nodejs server launched and started to listen to 4000 port, however endpoints calls to .NET backend are failing with status 0, to endpoints 'https://localhost:44328/.well-known/openid-configuration', 'https://localhost:44328/api/abp/application-configuration'. I have checked with browser, both URLs are accessible. My wild guess that there is some Abp request interceptors that prevents a requests from being sent in SSR mode(cant investigate deeper, since I don't have enough knowledge of underlying kitchen of abp).
Similar issue was reported here on github, here: https://github.com/abpframework/abp/issues/15782
7 Answer(s)
-
0
(from the morning) In my local, I am working on it. I have added angular universal. I am solving SSR issues. I will inform you. I may not completed in today. so I just want to say "I couldn't find fix yet but I am keep continue to working on it."
-
0
Thank you for an update Mahmut and your effort! No worries I was not expecting to get a fix today. It would be lovely to get some fix in upcoming week or two. I bet a fix will require several patches inside of ABP.
-
0
I have abstracted all storage functionaly from localstorage object. I have created cookie based storage too. I am still working on It. I couldn't fix fully yet. I will inform you.
-
0
Thank you for an update Mahmut!
-
0
Hello Mahmut, any update on this ticket?
-
0
@mahmut.gundogdu is there any estimate, when а problem could be solved?
-
0
I couldn't gave any deadline for this issue because so much code did not compatible with Server-side rendering yet. As a abp team we have task for that. We can implement soon as possible. Sorry for the delay. Also I have refund your credit.