问题
I created a new laravel application and added the auth template.
I tried to add this button:
<button type="button" class="btn btn-default btn-lg">
<span class="glyphicon glyphicon-stop" aria-hidden="true"></span>
</button>
But the glyphicons are not loading I get this error in my Chrome console:
GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb
GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158
GET http://localhost/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512
npm watch is already running.
What else could cause this error?
回答1:
Run command npm run dev
or npm run production
in production
https://laravel.com/docs/5.4/mix#running-mix
回答2:
This problem is caused by you accessing the site through http://localhost/something/public - and not using a VirtualHost.
Just had the exact same error myself, and realized it was requesting the files from http://localhost/ and not from the projectfolder.
来源:https://stackoverflow.com/questions/43095731/laravel-mix-bootstrap-glyphicons-not-loading