Shared folder with vagrant cause invisible characters appending

前端 未结 2 992
孤独总比滥情好
孤独总比滥情好 2021-02-19 01:59

I have a few invisible characters (�) that appear at the end of a javascript document that cause the \"illegal character\" error in FF or Chrome. I saw different topics about th

2条回答
  •  天命终不由人
    2021-02-19 02:43

    If you're using the VirtualBox provider, then VirtualBox shared folders are the default synced folder type. These synced folders use the VirtualBox shared folder system to sync file changes from the guest to the host and vice versa.

    There is a VirtualBox bug related to sendfile which can result in corrupted or non-updating files. You should deactivate sendfile in any web servers you may be running.

    In Nginx:

    sendfile off;
    

    In Apache:

    EnableSendfile Off
    

    See vagrant docs: http://docs.vagrantup.com/v2/synced-folders/virtualbox.html

提交回复
热议问题