Unexpected end of input or Unexpected token illegal
Oddly, the source file had barely changed (new line, for example) and there was no apparent error. Also, sometimes the file received seen through Chrome Developer Tools didn’t reflect the changes made on the source.
The problem appears when using shared folders through VirtualBox, and the fix is to add the following directive to your site description:
Extract from the Apache docs:
This directive controls whether
httpdmay use the sendfile support from the kernel to transmit file contents to the client. By default, when the handling of a request requires no access to the data within a file — for example, when delivering a static file — Apache uses sendfile to deliver the file contents without ever reading the file if the OS supports it.
This sendfile mechanism avoids separate read and send operations, and buffer allocations. But on some platforms or within some filesystems, it is better to disable this feature to avoid operational problems:
- Some platforms may have broken sendfile support that the build system did not detect, especially if the binaries were built on another box and moved to such a machine with broken sendfile support.
- On Linux the use of sendfile triggers TCP-checksum offloading bugs on certain networking cards when using IPv6.
- On Linux on Itanium, sendfile may be unable to handle files over 2GB in size.
- With a network-mounted
DocumentRoot(e.g., NFS or SMB), the kernel may be unable to serve the network file through its own cache.
For server configurations that are vulnerable to these problems, you should disable this feature by specifying:
For NFS or SMB mounted files, this feature may be disabled explicitly for the offending files by specifying:
<Directory "/path-to-nfs-files">EnableSendfile Off</Directory>
Please note that the per-directory and .htaccess configuration of
EnableSendfileis not supported by
mod_disk_cache. Only global definition of
EnableSendfileis taken into account by the module.
Nginx also has reference to this: https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#config-changes-not-reflected