After upgrading a current project from .Net 6 to 8 and all ServiceStack libraries to 8.1.2 and moving all the Plugins registration to builder.Services.AddPlugin() and calling services.AddServiceStack() in Program.cs, everything seemed to work just fine…
Until I cleared all of my dev browser’s history (Firefox Developer Edition), which then caused the API Explorer UI not to render anymore. It has a JS error and I’m not a JS guy. Have you seen this before or have any pointers on how to solve it?
Your respnse made me think… I wonder if it’s got anything to do with the fact that the website and api are being mounted on a specific URL path rather then on the root.
Anyway on Monday I’ll ask a colleague who is way more versed in User Interface, HTML and JavaScript than me and see what we can find in the source code of the /ui page.
Sounds like something is corrupting the /ui/lib/app.mjs file in ServiceStack.dll
It’s bizarre why it’s only happening to this file and not the other embedded resource files. The lack of a X-Powered-By HTTP Response Header also suggests this response isn’t being returned by ServiceStack.
Can you try requesting the /admin-ui/lib/app.mjs and /locode/lib/app.mjs for the other built-in UIs to still see if it returns a 403 response as maybe the app.mjs name might be triggering some restriction filter/middleware returning a forbidden response.
I had more time to spend on this today. With your clue below:
for the other built-in UIs to still see if it returns a 403 response as maybe the app.mjs name might be triggering some restriction filter/middleware returning a forbidden response.
I went through the code and found that a PreRequest filter had been setup for most of the built-in UIs. I removed them from the screenshot below and bingo problem solved.
Again, thank you so much for the invaluable help!
Next week I will try to upgrade some .Net 4.7.2 Framework APIs which are on ServiceStack version 6.1… you might hear from me again
It’s 5:10pm here in Brisbane, Australia - time to go and enjoy the weekend. Have a good one.