Failed to read... problem

Jul 17, 2009 at 4:09 PM
Edited Mar 29, 2010 at 8:44 AM

Hello,

Excellent work on this project however I seem to have 1 file (out of 40) that causes problems.

The file is a JS jQuery file and can be found at:

http://layout.jquery-dev.net/download/jquery.layout.js

I have tried the version in the downloads and the latest version I compiled myself from the source code and neither seems to handle this file.

 

Thanks,

Phil

 

Error    3    Failed to read in the data for the path/file [..\Content\js\libraries_plugin\jquery.layout.js]. The most common cause for this is because the path is incorrect or the file name is incorrect ... so please check your path and file names. Until you fix this up, I can't continue ... sowwy.    C:\-----------\MSBuildSettings.xml    112    5

Error    4    [ERROR] invalid property id    C:\------------\MSBuildSettings.xml    112    5

Error    5    Failed to read in the data for the path/file [..\Content\js\libraries_plugin\jquery.layout.js]. The most common cause for this is because the path is incorrect or the file name is incorrect ... so please check your path and file names. Until you fix this up, I can't continue ... sowwy.    C:\------------\MSBuildSettings.xml    112    5

Error    6    [ERROR] invalid property id    C:\-------------\MSBuildSettings.xml    112    5 

Error    7    The command "c:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe "C:\-----------\MSBuildSettings.xml"" exited with code -1.

Coordinator
Jul 18, 2009 at 12:57 AM
Edited Jul 18, 2009 at 12:58 AM

Hi Philjones88,

    thanks for taking the time to check out this project :) Thanks for providing a link to the original source. I'll download and grab it now and give it a go locally on my dev box, here at work. It's been a while, but finally the current release in the 'Downloads' tab is the most recent version of the source control (as of the time of me posting this reply :P ).

 

My first impression looks like the msbuild magic can't find the file or fails to read in some data -- as opposed to the parser itself not having any luck. So while I give it a go locally, is there any chance you could do the following :-

 

  1. First, try and remove _everything_ from the file where you're doing the compression/minification. if this is manually with a postbuild event or just with the command line, then this would be an .xml file. If this is part of a web deployment project, then it would be your .wdproj file.
  2. If the attempt above still fails, can u please post the .xml or .wdproj file. Cheers :)

(i'll post my results very shortly when I give this a go).

 

EDIT: My guess is you're manually doing this OR doing this via a PostBuild event, with an xml file called MSBuildSettings.xml (based on the error message, above).

 

-PK-

 

 

Coordinator
Jul 18, 2009 at 1:31 AM
Edited Jul 18, 2009 at 1:38 AM

OK. had a look a figure out what was going wrong.

My first hint was an msbuild parsing error (ie. failed to find the file, etc) - this was wrong.

Second clue was this:- Error    4    [ERROR] invalid property id    C:\------------\MSBuildSettings.xml    112    5

Bascially, WTF? Is that a msbuild public property that it's bitching about? (and ingore those random numbers... that's just error lines and character positions, etc).

Hmm. it sounds like the javascript PARSER is failing (which is not a good thing, 'cause then i've not ported this puppy right). One way to find out -> lets run this against the original current (v2.4.2) java version...

/me hops online, downloads java and installs it ('cause i'm gonna do a format in a week or two when Win7 RTM's .. otherwise i would have done this on a Virtual PC image and then nuke it later.. ).
/me runs the file against the original .jar file....

looks like even the ORIGINAL code can't parse this correctly. I'm sorry mate, my hands are tied. Because I'm doing a port, I even port across the bugs to keep it as sync as possible.....

My best guess here would be to contact the original YUI Compressor guys over at the Yahoo UI Library.

GL and once more, soz mate.

EDIT: Fixed the image link and the external web page link.

EDIT 2: I think these are the two offending lines... i THINK ...



If that's the case, then the only common piece of code between the two files is the 'float' attribute... HTH.

Jul 20, 2009 at 8:55 AM

Thanks for your help, the lines you have in your last picture were causing the problem. Putting the float in quotes seems to fix the issue.

I have posted on the jQuery plugin authors support forums to let him know and hopefully save anyone else the headaches :)

 

Phil

Nov 19, 2012 at 4:47 PM
Edited Nov 19, 2012 at 4:59 PM

Everytime I add this piece of code below, MSBuild breaks showing [ERROR] missing variable name. Failed to read in the data for the path/file

Indeed it seems that the compressor gets confused. I am not sure if it throws an error with regex symbols.

Regarding my piece of code, it was throwing an exception "missing variable name", but when I renamed the int variable with another name, the compressor worked. :-D

 

/*s.format() // Displays "87,345.87"*/
String.prototype.format = function () {
    var int = this; //int is a BAD variable name for Yahoo compressor!

    if (int.indexOf(',') > 0 && int.indexOf(".") == -1)
        int = int.replace(",", ".");

    var parts = int.split(".");
    int = parts[0];
    var dec = "00";
    if (parts.length > 1) {
        int = int.split(/(?=(?:\d{3})+(?:\.|$))/g).join(",");
        dec = parts[1].padRight(2, '0');
        parts.length = parts.length - 1;
    }
    return int.replace(",", ".") + "," + dec;
};


Coordinator
Nov 20, 2012 at 6:49 AM

Hi,

It would do yes, int is a reserved word in javascript so you can't define a variable "int".

http://javascript.about.com/library/blreserved.htm

Coordinator
Nov 21, 2012 at 3:17 AM
Edited Nov 21, 2012 at 3:18 AM

@JuniorMayhe

FreeRanger is right - u can't have a variable called 'int'.

var int = this; //int is a BAD variable name for Yahoo compressor!

In fact, i've always thought javascript would error if someone tried to use a reserved word as a variable name.