Closed petergaal91 closed 3 years ago
Hi, I had the same problem while using the 5.0.0-alpha.4 version, I don't have a public/img/
folder, but simply adding a dummy favicon.ico file in the public/
folder fixed the issue. It turns out that I had a a reference to <%= BASE_URL %>favicon.ico
in my index.html
.
Throwing a more explicit error message might be useful.
@petergaal91 An image might be referenced somewhere in your code, could you provide an example repo or the steps you took to generate the app ?
Yep, the favicons:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="shortcut icon" href="<%= BASE_URL %>assets/images/favicons/android-chrome-192x192.png">
<link rel="apple-touch-icon" href="<%= BASE_URL %>assets/images/favicons/android-chrome-512x512.png" sizes="512x512">
</head>
<body>
<div id="app"></div>
</body>
</html>
Yep, the favicons:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <link rel="shortcut icon" href="<%= BASE_URL %>assets/images/favicons/android-chrome-192x192.png"> <link rel="apple-touch-icon" href="<%= BASE_URL %>assets/images/favicons/android-chrome-512x512.png" sizes="512x512"> </head> <body> <div id="app"></div> </body> </html>
Does the app build successfully if you delete the two links to the favicons ?
Unfortunately no, but your solution solved my issue temporary.
The root cause comes from here. the NoErrorOnMissing flag can be a solution in this case
This problem only occurs when the
For SPA, this problem occurs If public
is an empty folder? Why not remove your public
folder directly ? public
folder only contains index.html
or public
folder is empty
public
folder contains the index.html so I don't want to delete it. I opened a PR to fix this: PR
Close via #6333
Version
5.0.0-alpha.3
Environment info
Steps to reproduce
What is expected?
no error
What is actually happening?
ERROR Failed to compile with 1 error 20:27:47 error
unable to locate 'D:/Workspace/vue3/public/**/*' glob
I think it's a copy-webpack-plugin related bug, but i'm not 100% sure. Related Vue CLI code: here