Hi again!
That's the nastiest bug I've seen in a long-long time, thanks Alexey for
finding the answer. It's a Virtualbox/Vagrant bug. The solution is to turn
off the sendfile system call in httpd.conf in your apache or nginx[1]:
EnableSendfile off
I hope this will be useful for the developers that use vagrant and have
problems with partially loaded js-files or garbage in their scripts.
[1]
https://groups.google.com/forum/#!topic/vagrant-up/7RgBxo6EksQ
Cheers,
Yury
-----
Yury Katkov
On Tue, Jul 29, 2014 at 12:19 PM, Yury Katkov <katkov.juriy(a)gmail.com>
wrote:
Hi!
I have the following setup: I develop on my local machine (PHPstorm) and I
save the files in one of the Vagrant shared folders. I load my js files
like that:
public static function onBeforePageDisplay( OutputPage &$out, Skin
&$skin ) {
$out->addModules("ext.Pydio");
}
The thing is that sometimes after I make a change I see that my javascript
files is either not fully loaded (and I have undexpected end of file
error), or loaded with some invisible characters (\u0) right after the end
of the file (and I have "unexpected toke ILLEGAL" error). It looks like
this:
http://i.imgur.com/GGxtD89.png - my code in phpstorm
http://i.imgur.com/I8UR8Ly.png - my error in Chrome developer tools
The javascript itself is totally ok. In fact the problem can appear even
when I just add a comment to the file.
My first thought was that it's vagrant shared folders bug. It doesn't seem
to be true - the file on the virtual machine looks normal.
Can it be the ResourceLoader issue? Did anyone see this behavior before?
Cheers,
-----
Yury Katkov