Laravel Mix Bootstrap Glyphicons not loading

安稳与你 提交于 2021-02-10 05:18:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!