JS error when using vagrant as the development environment

Source: Internet
Author: User
Tags sendfile

When you try to modify a JS, and update with the same method, you will encounter similar problems, yes, even restarting any service on the VM, even restarting the VM, it is still useless, of course, compared to other resource files, the browser will react strongly, because the browser prompts unknown errors, And you view your modified JS file through the browser, you will see the file tail has the following strange random characters:

?????????????????

What the hell is this thing? Coding error? Cache exceptions? or something else?

Yes, you try to spend a lot of time experimenting with various methods to solve this problem, in fact, for Nginx, you only need to modify the configuration file (nginx.conf) in a single line of the restart can be simple to solve the problem:

sendfile off;

Find nginx.conf and change the "sendfile on" inside to "sendfile off".

Of course, if you use Apache and you may encounter similar problems, there are similar configurations that need to be modified:

Enablesendfile off

Reference:

Https://blog.smdcn.net/article/1325.html

https://github.com/mitchellh/vagrant/issues/351#issuecomment-1339640

Http://stackoverflow.com/questions/9479117/vagrant-virtualbox-apache2-strange-cache-behaviour

JS error when using vagrant as the development environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.