The browser console was showing errors when loading PromptSpark Explorer pages:
Refused to apply style from 'https://localhost:55863/promptspark' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
The issue was caused by CSS paths using the tilde (~) syntax (~/dist/css/PromptSpark.min.css) in PromptSpark views. When the browser was on nested routes like /promptspark/explorer/details/sometype, the relative path resolution was causing the browser to request CSS from incorrect paths.
Changed all CSS references in PromptSpark views from relative paths using tilde (~) syntax to absolute paths starting from the root (/):
WebSpark.Portal\Areas\PromptSpark\Views\Explorer\Details.cshtmlWebSpark.Portal\Areas\PromptSpark\Views\Explorer\Index.cshtmlWebSpark.Portal\Areas\PromptSpark\Views\Home\TestOnPageNavigation.cshtmlWebSpark.Portal\Areas\PromptSpark\Views\ChatCompletion\Enhanced.cshtml
Before:
<link href="~/dist/css/PromptSpark.min.css" rel="stylesheet" />After:
<link href="/dist/css/PromptSpark.min.css" rel="stylesheet" />- ? Build completed successfully
- ? CSS files exist in
wwwroot/dist/css/PromptSpark.min.csswebspark.min.css
- ? NPM build completed successfully (with only harmless Bootstrap deprecation warnings)
- The main layout (
_Layout.cshtml) already uses absolute paths and was not affected - This fix ensures consistent behavior across all routing depths
- The issue only affected PromptSpark area views that used relative paths
- CSS compilation and build processes continue to work normally
After deployment, verify that:
- PromptSpark Explorer index loads without CSS errors
- PromptSpark Explorer details pages load without CSS errors
- All PromptSpark area styling appears correctly
- Browser developer tools show no 404 errors for CSS files