After packaging the vue file, the page is blank and an error appears

The error is as follows:

Refused to apply style from 'http://127.0.0.1:5500/css/chunk-43aa77e1.33bcbef1.css' because its MIME type ('text/html') is 
not a supported stylesheet MIME type, and strict MIME checking is enabled.Failed to load resource: the server responded 
with a status of 404 (Not Found)

This block code means:
reject the application of'http : //127.0.0.1 : 5500/css/ chunk- 43aa77e1.33bcbef1.css' because its MIME type ('text/html') is not a supported style sheet MIME type , And requires strict MIME checking is enabled. Failed to load resource: the server's response status is 404 (not found)

Failed to load resource: the server responded with a status of 404 (Not Found)

This block of code means:
failed to load resource: the server responded with a status of 404 (not found)

The reason for this type of error is that there are too many files such as js, css, etc., which need to be manually added (./) to obtain the current file path, but too many files such as js manually add the path will cause conflicts.
The solution to this type of error is: Add a file named vue.config.js to the root directory, the operation is as follows
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/Z_hai_yan/article/details/115357903