I am currently working on a project using Java with Spring Boot in IntelliJ IDEA, managed by Maven. However, I am facing an issue when trying to connect bootstrap.min.css on my HTML page.
This problem seems to appear randomly without any clear cause. Interestingly, I have multiple projects that are identical, and some encounter this problem while others do not.
I am linking bootstrap.min.css the same way as shown on this page https://getbootstrap.com/docs/4.3/getting-started/introduction/
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>LoginPage2</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="/static/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
Upon checking the browser console, I see the following error message:
Refused to apply style from 'http://localhost:8081/static/css/bootstrap.min.css' because its MIME type ('application/json') is not a supported stylesheet MIME type, and strict MIME checking is enabled